Skip to content

Instantly share code, notes, and snippets.

@wchristian
Created October 8, 2010 12:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wchristian/616705 to your computer and use it in GitHub Desktop.
#!/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