Skip to content

Commit

Permalink
improved the custom exception and not_found recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 18, 2011
1 parent beb6304 commit bcebcdb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.01 2011-10-18 00:00:00
2.01 2011-10-19 00:00:00
- Improved documentation.

2.0 2011-10-17 00:00:00
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -844,8 +844,8 @@ will not be encoded.
$c->render_exception('Oops!');
$c->render_exception(Mojo::Exception->new('Oops!'));
Render the exception template C<exception.$mode.$format.$handler> or
C<exception.$format.$handler> and set the response status code to C<500>.
Render the exception template C<exception.$mode.$format.*> or
C<exception.$format.*> and set the response status code to C<500>.
=head2 C<render_json>
Expand All @@ -870,8 +870,8 @@ Disable auto rendering, especially for long polling this can be quite useful.
$c->render_not_found;
$c->render_not_found($resource);
Render the not found template C<not_found.$mode.html.$handler> or
C<not_found.html.$handler> and set the response status code to C<404>.
Render the not found template C<not_found.$mode.$format.*> or
C<not_found.$format.*> and set the response status code to C<404>.
=head2 C<render_partial>
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -611,14 +611,15 @@ to C<CPAN>.
$ make dist
$ mojo cpanify -u USER -p PASS Mojolicious-Plugin-DebugHelper-0.01.tar.gz

=head2 Mode specific C<exception> and C<not_found> templates
=head2 Custom C<exception> and C<not_found> templates

While the built-in C<exception> and C<not_found> templates are very useful
during development, you most likely want to show your users something more
related to your application in production.
That's why L<Mojolicious> will always try to render
C<exception.$mode.$format.*> or C<not_found.$mode.$format.*> before falling
back to the built-in default templates.
C<exception.$mode.$format.*>/C<not_found.$mode.$format.*> or
C<exception.$format.*>/C<not_found.$format.*> before falling back to the
built-in default templates.

@@ exception.production.html.ep
<!doctype html><html>
Expand Down

0 comments on commit bcebcdb

Please sign in to comment.