Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Exceptions;

use GlueDev\Laravel\Stackdriver\StackdriverExceptionHandler;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;

Expand Down Expand Up @@ -36,14 +35,12 @@ class Handler extends ExceptionHandler
];

/**
* Report or log an exception.
*
* @param \Throwable $e
* @return void
* Register the exception handling callbacks for the application.
*/
public function report(Throwable $e)
public function register()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked about this; we just wanted to check that this will behave in the same way as before but is the new recommended way to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the docs this seems to be recommended, although I now realized a reason to override the report function may be if you want to call it yourself when there is no Exception (see section The report helper)

Copy link
Contributor Author

@deer-wmde deer-wmde Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we do this anywhere though. edit: not true, there are in fact 3 occurences of this in our code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I have to correct myself again, after testing locally I could verify that the handler still gets called this way, so we should be good.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, this is excellent

{
StackdriverExceptionHandler::report($e);
parent::report($e);
$this->reportable(function (Throwable $e) {
(new \Absszero\ErrorReporting)->report($e);
});
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"license": "MIT",
"type": "project",
"require": {
"absszero/laravel-stackdriver-error-reporting": "^1.7",
"cviebrock/eloquent-sluggable": "^9.0",
"doctrine/dbal": "^3.1",
"firebase/php-jwt": "^5.4",
"fruitcake/laravel-cors": "^2.0",
"gluedev/laravel-stackdriver": "dev-develop#7fb3e78ce949dd341b5418f876c3ff74d8c1ff92",
"google/recaptcha": "^1.2",
"guzzlehttp/guzzle": "^7.8",
"guzzlehttp/psr7": "^1.9",
Expand Down
Loading