Skip to content

Commit 9d33d28

Browse files
authored
Merge pull request #5237 from Laravel-Backpack/fix-exception-error
throw http errors in custom exceptions to render the error views
2 parents 082ab44 + 92405f1 commit 9d33d28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/Exceptions/AccessDeniedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class AccessDeniedException extends Exception
1414
*/
1515
public function render($request)
1616
{
17-
return response(view('errors.403', ['exception' => $this]), 403);
17+
return abort(403, $this->getMessage());
1818
}
1919
}

src/app/Exceptions/BackpackProRequiredException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ public function render($request)
2020
break;
2121
}
2222

23-
return response(view('errors.500', ['exception' => $this]), 500);
23+
return abort(500, $this->getMessage());
2424
}
2525
}

0 commit comments

Comments
 (0)