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;
|
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 [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue