From: Florian Ragwitz Date: Fri, 26 Jun 2009 15:28:06 +0000 (+0000) Subject: Detect redispatch exceptions by a class check, not by checking the exception message. X-Git-Tag: 5.80006~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=79f5d5718d885ee1c3f288159a31562f9cf5b02f;hp=154ef0c8918fbe9315ae5e66ae609548dd550165 Detect redispatch exceptions by a class check, not by checking the exception message. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 86865b2..a751984 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1511,10 +1511,10 @@ sub execute { my $last = pop( @{ $c->stack } ); if ( my $error = $@ ) { - if ( ref($error) and $error eq $DETACH ) { + if ( blessed($error) and $error->isa('Catalyst::Exception::Detach') ) { die $DETACH if($c->depth > 1); } - elsif ( ref($error) and $error eq $GO ) { + elsif ( blessed($error) and $error->isa('Catalyst::Exception::Go') ) { die $GO if($c->depth > 0); } else {