diff --git a/src/Url.php b/src/Url.php index 29cd74b..5f4dbb0 100644 --- a/src/Url.php +++ b/src/Url.php @@ -454,16 +454,24 @@ class Url { if(self :: $request -> authenticated && !Auth::login(true)) Log :: fatal(I18n::_("Authentication required but fail to authenticate you.")); + Hook::trigger('before_handling_request', array('request' => self :: $request)); + $success = false; try { - call_user_func(self :: $request -> handler, self :: $request ); + call_user_func(self :: $request -> handler, self :: $request); + $success = true; } catch (Exception $e) { Log :: exception( $e, "An exception occured running URL handler %s", format_callable(self :: $request -> handler)); - Log :: fatal(I18n::_("This request could not be processed correctly.")); } + Hook::trigger( + 'after_handling_request', + array('request' => self :: $request, 'success' => $success) + ); $sentry_span->finish(); + if (!$success) + Log :: fatal(I18n::_("This request could not be processed correctly.")); } /**