[Dancer-users] Exception handling

Angel Arancibia angel.arancibia at gmail.com
Mon Dec 12 17:56:39 CET 2011


Hi, i'm following http://advent.perldancer.org/2011/6 but i'm a bit
confussed, Dancer::Exceptions didn't have "register_exception" neither
"does" defined. Also, the documentation at CPAN says "exceptions have no
method to call on"

I'm using Dancer 1.3080 and I would like to do something like this:


register_custom_exception('Test', message_pattern => "Test message: %s" );
-----
use Test::More import => ['!pass'], tests => 1;
use Dancer::Exception qw(:all);

try {
    raise Test => "Error!";
}
catch {
    my ($exception) = @_;
    ok($exception->does('Test'),"Exception");
};


Thanks in advance

Angel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20111212/cb90b0ab/attachment.htm>


More information about the Dancer-users mailing list