Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
better example for exception templates
  • Loading branch information
kraih committed Apr 13, 2013
1 parent 2963891 commit 776ed11
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.96 2013-04-13
3.96 2013-04-14
- Improved default descriptions in Test::Mojo.
- Improved documentation.

Expand Down
4 changes: 3 additions & 1 deletion lib/Mojolicious/Controller.pm
Expand Up @@ -691,7 +691,9 @@ be encoded. All additional values get merged into the C<stash>.
$c->render_exception(Mojo::Exception->new('Oops!'));
Render the exception template C<exception.$mode.$format.*> or
C<exception.$format.*> and set the response status code to C<500>.
C<exception.$format.*> and set the response status code to C<500>. Also sets
the stash values C<exception> to a L<Mojo::Exception> object and C<snapshot>
to a copy of the C<stash> for use in the templates.
=head2 render_json
Expand Down
5 changes: 4 additions & 1 deletion lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -364,7 +364,10 @@ templates.
<!DOCTYPE html>
<html>
<head><title>Server error</title></head>
<body><%= $exception %></body>
<body>
<p>Exception:<%= $exception->message %></p>
<p>Stash:<%= dumper $snapshot %></p>
</body>
</html>

=head2 Helpers
Expand Down

0 comments on commit 776ed11

Please sign in to comment.