Skip to content

Commit

Permalink
link to Mojo::Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 22, 2015
1 parent e6f5d1e commit 57e3f61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/Mojo/Loader.pm
Expand Up @@ -172,8 +172,10 @@ Search for modules in a namespace non-recursively.
my $e = load_class 'Foo::Bar';
Load a class and catch exceptions. Note that classes are checked for a C<new>
method to see if they are already loaded.
Load a class and catch exceptions, returns a false value if loading was
successful, a true value if the class has already been loaded, or a
L<Mojo::Exception> object if loading failed. Note that classes are checked for a
C<new> method to see if they are already loaded.
# Handle exceptions
if (my $e = load_class 'Foo::Bar') {
Expand Down
11 changes: 7 additions & 4 deletions lib/Mojo/Template.pm
Expand Up @@ -619,7 +619,7 @@ Build Perl L</"code"> from L</"tree">.
=head2 compile
my $exception = $mt->compile;
my $e = $mt->compile;
Compile Perl L</"code"> for template and return a L<Mojo::Exception> object, or
C<undef> if there was no exception.
Expand All @@ -629,7 +629,8 @@ C<undef> if there was no exception.
my $output = $mt->interpret;
my $output = $mt->interpret(@args);
Interpret L</"compiled"> template code and return the result.
Interpret L</"compiled"> template code and return the result, or a
L<Mojo::Exception> object if rendering failed.
# Reuse template
say $mt->render('Hello <%= $_[0] %>!', 'Bender');
Expand All @@ -647,7 +648,8 @@ Parse template into L</"tree">.
my $output = $mt->render('<%= 1 + 1 %>');
my $output = $mt->render('<%= shift() + shift() %>', @args);
Render template and return the result.
Render template and return the result, or a L<Mojo::Exception> object if
rendering failed.
say $mt->render('Hello <%= $_[0] %>!', 'Bender');
Expand All @@ -656,7 +658,8 @@ Render template and return the result.
my $output = $mt->render_file('/tmp/foo.mt');
my $output = $mt->render_file('/tmp/foo.mt', @args);
Render template file and return the result.
Render template file and return the result, or a L<Mojo::Exception> object if
rendering failed.
=head1 DEBUGGING
Expand Down

0 comments on commit 57e3f61

Please sign in to comment.