Use the HttpExceptionInterface rather than a render function here

This commit is contained in:
Dane Everitt 2019-03-03 13:57:18 -08:00
parent f15449f17b
commit 3411df784a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -2,19 +2,28 @@
namespace Pterodactyl\Exceptions\Repository; 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 * Returns the status code.
* 404 page view.
* *
* @param \Illuminate\Http\Request $request * @return int
* @return \Illuminate\Http\Response
*/ */
public function render($request) public function getStatusCode()
{ {
if (! config('app.debug')) { return Response::HTTP_NOT_FOUND;
return response()->view('errors.404', [], 404); }
}
/**
* Returns response headers.
*
* @return array
*/
public function getHeaders()
{
return [];
} }
} }