Skip to content

Commit 3fa449a

Browse files
authored
Merge pull request #11 from phailee/5.6
Fix: response bug fix
2 parents 1033747 + 681da4b commit 3fa449a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Handlers/ApiExceptionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public function render($request, \Exception $e)
2121
$debug = config('app.debug');
2222
if (!$debug) {
2323
if ($e instanceof HttpResponseException || $e instanceof \Illuminate\Validation\ValidationException) {
24-
if ($e->getResponse()->getStatusCode() == 403) {
24+
if ($e->status == 403) {
2525
return ApiResponse::exception(new UnauthorizedException());
2626
}
2727
else {
28-
return ApiResponse::exception(new ValidationException(json_decode($e->getResponse()->getContent(), true)));
28+
return ApiResponse::exception(new ValidationException($e->errors()));
2929
}
3030
}
3131
else if ($e instanceof NotFoundHttpException) {

0 commit comments

Comments
 (0)