We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c974049 commit 82d1e1aCopy full SHA for 82d1e1a
src/Twig/TwigServiceProvider.php
@@ -6,13 +6,19 @@
6
7
use Exception;
8
use Illuminate\Contracts\Debug\ExceptionHandler;
9
+use Illuminate\Foundation\Exceptions\Handler;
10
use Illuminate\Support\ServiceProvider;
11
+use Override;
12
13
final class TwigServiceProvider extends ServiceProvider
14
{
- #[\Override]
15
+ #[Override]
16
public function register(): void
17
- $this->app->make(ExceptionHandler::class)->map(Exception::class, fn (Exception $e) => $this->app->make(TwigMapper::class)->map($e));
18
+ $handler = $this->app->make(ExceptionHandler::class);
19
+
20
+ if ($handler instanceof Handler) {
21
+ $handler->map(Exception::class, fn (Exception $e) => $this->app->make(TwigMapper::class)->map($e));
22
+ }
23
}
24
0 commit comments