Subject: | make Catalyst::Dispatcher::detach compatible with Devel::SimpleTrace |
This is perhaps more an issue with Devel::SimpleTrace but one that
should be easily fixable in Catalyst itself.
The essence of Devel::SimpleTrace is that it hijacks the die and warn
handlers and adds a stack trace to the original die/warn message. This
is very useful for debugging but causes $c->detach to break because the
the exception no longer matches the expected $Catalyst::DETACH value and
treats it as if it were a normal die and not an attempt to abort the
request's flow.
The workaround for this is to make $Catalyst::DETACH a reference as
Devel::SimpleTrace explicitly avoids modifying $@'s that are a also
refs. This could probably be a simple scalar ref or a full-blown
exception object (perhaps with overloaded stringification to provide
backwards compatibility).
Could this be tweaked inside Catalyst so that detach works as expected
even when Devel::SimpleTrace is in play?
Thanks!