sub update_blog_post { my ($self, $req, $ident) = @_; eval { my $post = $self->blog_model->load( $ident ); ... }; if ($@) { # report the error } }