Skip to content

Commit f445519

Browse files
authored
Merge pull request #91 from BinaryStudioAcademy/dev
Dev
2 parents 2044fcf + 90f7c6a commit f445519

File tree

4 files changed

+1138
-83
lines changed

4 files changed

+1138
-83
lines changed

backend/app/Exceptions/Handler.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Illuminate\Http\JsonResponse;
1111
use Illuminate\Http\Request;
1212
use Illuminate\Http\Response;
13+
use Illuminate\Support\Facades\Config;
1314
use Illuminate\Validation\ValidationException;
1415
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
1516
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -41,9 +42,18 @@ class Handler extends ExceptionHandler
4142
*
4243
* @param Exception $exception
4344
* @return void
45+
* @throws Exception
4446
*/
4547
public function report(Exception $exception)
4648
{
49+
if (
50+
$this->shouldReport($exception)
51+
&& Config::get('app.env') === 'production'
52+
&& app()->bound('sentry')
53+
) {
54+
app('sentry')->captureException($exception);
55+
}
56+
4757
parent::report($exception);
4858
}
4959

backend/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"pda/pheanstalk": "^4.0",
2121
"predis/predis": "^1.1",
2222
"pusher/pusher-php-server": "^3.4",
23+
"sentry/sentry-laravel": "1.0.2",
2324
"tymon/jwt-auth": "1.0.*"
2425
},
2526
"require-dev": {

0 commit comments

Comments
 (0)