Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added exception monitoring recipe
  • Loading branch information
kraih committed Jul 5, 2012
1 parent 1f2530d commit 1185770
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -626,6 +626,15 @@ common use.
if $self->res->code;
});

Same for monitoring tasks.

# Forward exceptions to a web service
$self->hook(after_dispatch => sub {
my $self = shift;
return unless my $e = $self->stash('exception');
$self->ua->post_form('https://kraih.com/bugs' => {exception => $e});
});

For a full list of available hooks see L<Mojolicious/"hook">.

=head2 Shortcuts
Expand Down

0 comments on commit 1185770

Please sign in to comment.