From 3411df784a21e7e27e67a295fc5eee94278d6dcb Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 3 Mar 2019 13:57:18 -0800 Subject: [PATCH] Use the HttpExceptionInterface rather than a render function here --- .../Repository/RecordNotFoundException.php | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/app/Exceptions/Repository/RecordNotFoundException.php b/app/Exceptions/Repository/RecordNotFoundException.php index f449faa42..53cfa2222 100644 --- a/app/Exceptions/Repository/RecordNotFoundException.php +++ b/app/Exceptions/Repository/RecordNotFoundException.php @@ -2,19 +2,28 @@ namespace Pterodactyl\Exceptions\Repository; -class RecordNotFoundException extends RepositoryException +use Illuminate\Http\Response; +use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; + +class RecordNotFoundException extends RepositoryException implements HttpExceptionInterface { /** - * Handle request to render this exception to a user. Returns the default - * 404 page view. + * Returns the status code. * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response + * @return int */ - public function render($request) + public function getStatusCode() { - if (! config('app.debug')) { - return response()->view('errors.404', [], 404); - } + return Response::HTTP_NOT_FOUND; + } + + /** + * Returns response headers. + * + * @return array + */ + public function getHeaders() + { + return []; } }