[Catalyst] Catching exceptions

Matt S Trout dbix-class at trout.me.uk
Sat Jun 3 17:38:50 CEST 2006


catalyst at augensalat.de wrote:
> Something I am unable to find in the documentation:
> 
> What is the recommended way to catch exception, either runtime errors or 
> self generated ones with Catalyst::Exception or by methods like 
> $c->assert_user_roles() (from C:P:Authorization::Roles)?
> 
> I don't want end users watching the default debug screen. ;-)

check $c->error in your end action, handle it, then call 
$c->clear_errors to prevent Catalyst generating an error screen. Note 
that in the absence of this so long as your app isn't in debugging mode 
users will see "Please come back later" in lots of languages, not a dump 
of your app's internals.



More information about the Catalyst mailing list