Permalink
Browse files

fix error handling to work on nom

  • Loading branch information...
1 parent 614bf1b commit 8930d9ce1a0d50b0ea47fbdd036864da54b0c5c9 @moritz committed Nov 29, 2011
Showing with 9 additions and 12 deletions.
  1. +9 −12 lib/CGI/Application.pm
View
@@ -92,18 +92,15 @@ multi method __get_body($rm) {
my $body;
try {
$body = $method ~~ Callable ?? $method() !! self."$method"();
- }
- # RAKUDO:
- # don't use a CATCH block here, because dying in a CATCH block
- # recurses infinitely.
- if $! {
- my $error = $!;
-# note("Calling 'error' hook ($!)");
- $.call-hook('error', $error);
- if $.error-mode {
- $body = self."$.error-mode"();
- } else {
- die "Error executing run mode '$rm': $error";
+ CATCH {
+ default {
+ $.call-hook('error', $!);
+ if $.error-mode {
+ $body = self."$.error-mode"();
+ } else {
+ die "Error executing run mode '$rm': $!";
+ }
+ }
}
}
return $body;

0 comments on commit 8930d9c

Please sign in to comment.