Exception::Died

Convert simple die into real exception object
Download

Exception::Died Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Piotr Roszatycki
  • Publisher web site:
  • http://search.cpan.org/~dexter/MooseX-GlobRef-Object-0.02/lib/MooseX/GlobRef/Object.pm

Exception::Died Tags


Exception::Died Description

Convert simple die into real exception object Exception::Died is a Perl module to convert simple die into real exception object.SYNOPSIS # Can be loaded via Exception::Base pragma use Exception::Base 'Exception::Died'; eval { open $f, "x", "bad_open_mode" }; Exception::Died->throw( message=>"cannot open" ) if $@; eval { die "Bum! " }; if ($@) { my $e = Exception::Died->catch; $e->throw; } # Can replace die hook globally use Exception::Died '%SIG' => 'die'; eval { die "Boom! " }; print ref $@; # "Exception::Died" print $@->eval_error; # "Boom!" # Can be used in local scope only use Exception::Died; { local $SIG{__DIE__} = &Exception::Died::__DIE__; eval { die "Boom!"; } print ref $@; # "Exception::Died" print $@->eval_error; # "Boom!" } eval { die "Boom"; } print ref $@; # ""This class extends standard Exception::Base and converts eval's error into real exception object. The eval's error message is stored in eval_error attribute. Requirements: · Perl


Exception::Died Related Software