Throwable::X
package MyBlog::Model::Blog; sub load { my ($self, $ident) = @_; MyBlog::X->throw( ident => 'blog_ident_missing', message => 'Cannot load Blog without ident', ) unless $ident; my $blog = $self->resultset( 'Blog' )->find( $ident ); return $blog if $blog; MyBlog::X->throw( ident => 'blog_not_found', message => "Cannot find Blog with ident $ident", ); }