From 49dbad37de98b744174a82773fcf7ec60088b6d3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 28 May 2023 19:46:50 +1000 Subject: [PATCH] improve handling of throttle exceptions --- app/Exceptions/Handler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 0d34120a66f5..9feccc7bca55 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -104,7 +104,8 @@ class Handler extends ExceptionHandler if (Ninja::isHosted()) { if($exception instanceof ThrottleRequestsException && class_exists(\Modules\Admin\Events\ThrottledExceptionRaised::class)) { - event(new \Modules\Admin\Events\ThrottledExceptionRaised(auth()->user()->account->key)); + $uri = urldecode(request()->getRequestUri()); + event(new \Modules\Admin\Events\ThrottledExceptionRaised(auth()->user()?->account?->key, $uri)); } Integration::configureScope(function (Scope $scope): void {