Skip to content

Commit 9f9dd74

Browse files
authored
Add in spiel about how you can access exception variables in a view
1 parent 86ddc9c commit 9f9dd74

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

errors.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ This method may be used at any time during the request's lifecycle.
119119

120120
Laravel makes it easy to return custom error pages for various HTTP status codes. For example, if you wish to customize the error page for 404 HTTP status codes, create a `resources/views/errors/404.blade.php`. This file will be served on all 404 errors generated by your application.
121121

122+
The exception raised by the abort method will be passed to the view as $exception, which allows you to present the user with the error message if needed. e.g.
123+
124+
$exception->getMessage()
125+
122126
The views within this directory should be named to match the HTTP status code they correspond to.
123127

124128
<a name="logging"></a>

0 commit comments

Comments
 (0)