Skip to content
This repository was archived by the owner on Nov 29, 2021. It is now read-only.

Commit 7285543

Browse files
authored
Merge pull request #13 from philkra/development
catch recursive exception of apm failing
2 parents acef9e9 + d45c2d9 commit 7285543

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Exceptions/ApmAgent.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
* Overloaded Exception Handler for Elastic APM Agent
88
*
99
* @link https://laravel.com/docs/5.6/errors
10+
* @link https://github.com/philkra/elastic-apm-laravel/issues/9
1011
*
1112
*/
1213

1314
use Exception;
1415
use App\Exceptions\Handler;
1516
use \PhilKra\Agent;
1617
use Illuminate\Support\Facades\Auth;
18+
use Illuminate\Support\Facades\Log;
1719

1820
class ApmAgent extends Handler
1921
{
@@ -32,8 +34,13 @@ public function __construct(Agent $agent)
3234
*/
3335
public function report(Exception $exception)
3436
{
35-
$this->agent->captureThrowable($exception);
36-
$this->agent->send();
37+
try {
38+
$this->agent->captureThrowable($exception);
39+
$this->agent->send();
40+
}
41+
catch(\Throwable $t) {
42+
Log::error($t);
43+
}
3744

3845
parent::report($exception);
3946
}

0 commit comments

Comments
 (0)