Created
September 12, 2011 15:28
-
-
Save ctfliblime/1211547 to your computer and use it in GitHub Desktop.
How to get this exception to percolate all the way up to the Plack middleware?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub reserve_GET : Args(1) { | |
my ($self, $c, @args) = @_; | |
try { | |
my $reserve = Koha::Model::Reserve->new(reservenumber => $args[0])->load; | |
$self->status_ok($c, entity=>as_tree($reserve)); | |
} | |
catch { | |
if (/^No such Koha::/) { | |
HTTP::Exception::404->throw; | |
} | |
else { | |
HTTP::Exception::500->throw; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment