Skip to content

Instantly share code, notes, and snippets.

@ctfliblime
Created September 12, 2011 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctfliblime/1211547 to your computer and use it in GitHub Desktop.
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?
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