Use the HttpExceptionInterface rather than a render function here
This commit is contained in:
parent
f15449f17b
commit
3411df784a
1 changed files with 18 additions and 9 deletions
|
@ -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 [];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue