Egg::Exception - The exception with stack trace is generated.


Egg-Release documentation  | view source Contained in the Egg-Release distribution.

Index


NAME

Top

Egg::Exception - The exception with stack trace is generated.

SYNOPSIS

Top

  use Egg::Exception;

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

  or

  local $SIG{__DIE__}= sub { Egg::Error->throw(@_) };
  die 'The error occurs.';

DESCRIPTION

Top

It is a module to vomit the message with stack trace when the exception is generated.

METHODS

Top

new

Constructor. This is internally called.

throw ([MESSAGE_STRING])

After the constructor is let pass, the exception is generated.

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

stacktrace

Only trace information on the object is returned.

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

frames

Trace information on the object is returned by the ARRAY reference.

  local $SIG{__DIE__}= sub { Egg::Error->throw(@_) };
  eval{ ... code. };
  if ($@) { die join "\n", @{$@->frames} }

as_string

as_string of Devel::StackTrace is returned.

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

errstr

Only the exception message of the object is returned.

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

SEE ALSO

Top

Egg::Release, Devel::StackTrace,

AUTHOR

Top

Masatoshi Mizuno, <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Release documentation  | view source Contained in the Egg-Release distribution.