Skip to content

Commit ef84e6c

Browse files
authored
Update ApiExceptionHandler.php
1 parent b403fd3 commit ef84e6c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Handlers/ApiExceptionHandler.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@
1010
use Froiden\RestAPI\Exceptions\ValidationException;
1111
use Illuminate\Database\Eloquent\ModelNotFoundException;
1212
use Illuminate\Database\QueryException;
13-
use Illuminate\Http\Exception\HttpResponseException;
13+
use Illuminate\Http\Exceptions\HttpResponseException;
1414
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
15+
use Throwable;
1516

1617
class ApiExceptionHandler extends Handler
1718
{
1819

19-
public function render($request, \Exception $e)
20+
public function render($request, Throwable $e)
2021
{
2122
$debug = config('app.debug');
2223
$prefix = config("api.prefix");
2324
// Check if prefix is set and use that debug
24-
// This is done to prevent default error message show in otherwise application
25+
// This is done to prevent default error message show in otherwise application
2526
// which are not using the api
2627
if (!$debug && $request->is($prefix.'/*')) {
2728
if ($e instanceof HttpResponseException || $e instanceof \Illuminate\Validation\ValidationException) {

0 commit comments

Comments
 (0)