diff --git a/routes/routes.php b/routes/routes.php index 6d06db3ba6..df08b4edc4 100644 --- a/routes/routes.php +++ b/routes/routes.php @@ -3,13 +3,11 @@ use Illuminate\Support\Facades\Route; use Statamic\API\Middleware\Cache; use Statamic\Facades\Glide; -use Statamic\Http\Middleware\API\SwapExceptionHandler as SwapAPIExceptionHandler; use Statamic\Http\Middleware\CP\SwapExceptionHandler as SwapCpExceptionHandler; use Statamic\Http\Middleware\RequireStatamicPro; if (config('statamic.api.enabled')) { Route::middleware([ - SwapApiExceptionHandler::class, RequireStatamicPro::class, Cache::class, ])->group(function () { diff --git a/src/Exceptions/ApiExceptionHandler.php b/src/Exceptions/ApiExceptionHandler.php deleted file mode 100644 index 81b4611ace..0000000000 --- a/src/Exceptions/ApiExceptionHandler.php +++ /dev/null @@ -1,16 +0,0 @@ -renderException($request, $e); - } -} diff --git a/src/Exceptions/Concerns/RendersApiExceptions.php b/src/Exceptions/Concerns/RendersApiExceptions.php deleted file mode 100644 index 96add28bd8..0000000000 --- a/src/Exceptions/Concerns/RendersApiExceptions.php +++ /dev/null @@ -1,28 +0,0 @@ -json(['message' => $e->getMessage()], 422); - } - - if ($e instanceof NotFoundHttpException) { - return response()->json(['message' => $e->getMessage() ?: 'Not found.'], 404); - } - - if ($e instanceof StatamicProAuthorizationException) { - throw new StatamicProRequiredException($e->getMessage()); - } - - return parent::render($request, $e); - } -} diff --git a/src/Http/Middleware/API/SwapExceptionHandler.php b/src/Http/Middleware/API/SwapExceptionHandler.php deleted file mode 100644 index d44d54ffc7..0000000000 --- a/src/Http/Middleware/API/SwapExceptionHandler.php +++ /dev/null @@ -1,14 +0,0 @@ -