Skip to content

Commit 3411df7

Browse files
committed
Use the HttpExceptionInterface rather than a render function here
1 parent f15449f commit 3411df7

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

app/Exceptions/Repository/RecordNotFoundException.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22

33
namespace Pterodactyl\Exceptions\Repository;
44

5-
class RecordNotFoundException extends RepositoryException
5+
use Illuminate\Http\Response;
6+
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
7+
8+
class RecordNotFoundException extends RepositoryException implements HttpExceptionInterface
69
{
710
/**
8-
* Handle request to render this exception to a user. Returns the default
9-
* 404 page view.
11+
* Returns the status code.
12+
*
13+
* @return int
14+
*/
15+
public function getStatusCode()
16+
{
17+
return Response::HTTP_NOT_FOUND;
18+
}
19+
20+
/**
21+
* Returns response headers.
1022
*
11-
* @param \Illuminate\Http\Request $request
12-
* @return \Illuminate\Http\Response
23+
* @return array
1324
*/
14-
public function render($request)
25+
public function getHeaders()
1526
{
16-
if (! config('app.debug')) {
17-
return response()->view('errors.404', [], 404);
18-
}
27+
return [];
1928
}
2029
}

0 commit comments

Comments
 (0)