diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index 6955d36a205..2f485666ebc 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -178,7 +178,7 @@ events directly from the kernel, again it will be registered automatically:: public function onKernelException(ExceptionEvent $event): void { - if ($event->getException() instanceof Danger) { + if ($event->getThrowable() instanceof Danger) { $event->setResponse(new Response('It\'s dangerous to go alone. Take this ⚔')); } }