The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Exception - Exception module for Egg.

SYNOPSIS

  use Egg::Exception;
  
  Egg::Error->throw('The error occurs.');
  
  sub run {
    my($e)= @_;
    local $SIG{__DIE__}= sub { Egg::Error->throw(@_) };
    eval {
      $e->call_method;
      };
    if ($@) {
      print STDERR "stack: ". $@->stacktrace;
    }
  }

DESCRIPTION

This is a module to treat the exception handling.

METHODS

Egg::Exception doesn't have the method. Please call the method of Egg::Error.

new

Constructor.

It processes it by Devel::StackTrace.

throw ( [MESSAGE] )

After the exception message is thrown to the constructor, die is done.

  Egg::Error->throw( 'internal error.' );

stacktrace

The stack trace that has accumulated is output.

  local $SIG{__DIE__}= sub { Egg::Error->throw(@_) };
  eval{ ... code. };
  if ($@) { die $@->stacktrace }

SEE ALSO

Devel::StackTrace, Egg::Release,

AUTHOR

Masatoshi Mizuno, <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2007 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.