Created
October 8, 2010 12:31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use feature 'say'; | |
use Try::Tiny; | |
use Exception::Class ( | |
'MyException', | |
'AnotherException' => { isa => 'MyException' }, | |
'YetAnotherException' => { | |
isa => 'AnotherException', | |
description => 'These exceptions are related to IPC' | |
}, | |
); | |
try { | |
die YetAnotherException->new( "argh" ); | |
} | |
catch { | |
say $_; | |
say ""; | |
say $_->message; | |
say ""; | |
say $_->description; | |
say ""; | |
say $_->error, "\n", $_->trace->as_string, "\n"; | |
say ""; | |
say join ' ', $_->euid, $_->egid, $_->uid, $_->gid, $_->pid, $_->time; | |
exit; | |
}; | |
__END__ | |
argh | |
argh | |
These exceptions are related to IPC | |
argh | |
Trace begun at D:\traffics\ec\script.pl line 18 | |
main::__ANON__[D:\traffics\ec\script.pl:19] at C:\Perl\site\lib\Try\Tiny.pm line 76 | |
eval {...} at C:\Perl\site\lib\Try\Tiny.pm line 67 | |
Try::Tiny::try('CODE(0x1ff890c)', 'Try::Tiny::Catch=REF(0x200a78c)') called at D:\traffics\ec\script.pl line 32 | |
0 0 0 0 6156 1286543061 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment