Skip to content

Commit 38c1588

Browse files
committed
minor #18598 Fix Method 'getException' not found in ExceptionEvent (IssamRaouf)
This PR was merged into the 6.2 branch. Discussion ---------- Fix Method 'getException' not found in ExceptionEvent The 'getException' method is not in ExceptionEvent and should be getThrowable. <img width="1157" alt="image" src="https://github.com/symfony/symfony-docs/assets/24827501/9b91d44c-1723-4649-8a45-fe5918f483a2"> <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- ebcd901 Fix Method 'getException' not found in ExceptionEvent
2 parents 7d49f56 + ebcd901 commit 38c1588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

configuration/micro_kernel_trait.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ events directly from the kernel, again it will be registered automatically::
178178

179179
public function onKernelException(ExceptionEvent $event): void
180180
{
181-
if ($event->getException() instanceof Danger) {
181+
if ($event->getThrowable() instanceof Danger) {
182182
$event->setResponse(new Response('It\'s dangerous to go alone. Take this ⚔'));
183183
}
184184
}

0 commit comments

Comments
 (0)