Merge remote-tracking branch 'origin/develop'
This commit is contained in:
@@ -19,6 +19,7 @@ use Illuminate\Validation\ValidationException;
|
||||
use Intervention\Image\Exception\NotSupportedException;
|
||||
use JsonException;
|
||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||
use Livewire\Exceptions\ComponentNotFoundException;
|
||||
use Livewire\Exceptions\PublicPropertyNotFoundException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Throwable;
|
||||
@@ -43,6 +44,7 @@ class Handler extends ExceptionHandler
|
||||
SCIMException::class, // these generally don't need to be reported
|
||||
InvalidFormatException::class,
|
||||
PublicPropertyNotFoundException::class,
|
||||
ComponentNotFoundException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -78,6 +80,12 @@ class Handler extends ExceptionHandler
|
||||
return response()->json(['message' => $e->getMessage()], 422);
|
||||
}
|
||||
|
||||
// A request named a Livewire component that doesn't exist in this app (e.g. bots probing
|
||||
// for Filament endpoints). Return 404 so it doesn't surface as a 500.
|
||||
if ($e instanceof ComponentNotFoundException) {
|
||||
return response()->json(['message' => 'Component not found.'], 404);
|
||||
}
|
||||
|
||||
// CSRF token mismatch error
|
||||
if ($e instanceof TokenMismatchException) {
|
||||
return redirect()->back()->with('error', trans('general.token_expired'));
|
||||
|
||||
Reference in New Issue
Block a user