Throwable::X
sub load { my ($self, $ident) = @_; MyBlog::X::BadParam->throw( ident => 'blog_ident_missing', message => 'Cannot load Blog without %{param}s', param => 'ident', ) unless $ident; my $blog = $self->resultset( 'Blog' )->find( $ident ); return $blog if $blog; MyBlog::X::NotFound->throw( ident => 'blog_not_found', message => 'Cannot find %{class} with ident %{id}', class => 'Blog', ident => $ident, ); }