Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

log::report::die(3pm) [debian man page]

Log::Report::Die(3pm)					User Contributed Perl Documentation				     Log::Report::Die(3pm)

NAME
Log::Report::Die - compatibility routines with Perl's die/croak/confess INHERITANCE
Log::Report::Die is a Exporter Functions die_decode(STRING) The STRING is the content of $@ after an eval() caught a die(). croak(), or confess(). This routine tries to convert this into parameters for Log::Report::report(). This is done in a very smart way, even trying to find the stringifications of $!. Return are four elements: the error string which is used to trigger a "Log::Report" compatible "die()", and the options, reason, and text message. The options is a HASH which, amongst other things, may contain a stack trace and location. Translated components will have exception classes "perl", and "die" or "confess". On the moment, the "croak" cannot be distiguished from the "confess" (when used in package main) or "die" (otherwise). The returned reason depends on whether the translation of the current $! is found in the STRING, and the presence of a stack trace. The following table is used: errstr stack => reason no no ERROR (die) application internal problem yes no FAULT (die) external problem, think open() no yes PANIC (confess) implementation error yes yes ALERT (confess) external problem, caught = @{$opt{stack}} ? ($opt{errno} ? 'ALERT' : 'PANIC') : ($opt{errno} ? 'FAULT' : 'ERROR'); SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Die(3pm)

Check Out this Related Man Page

Log::Report::Exception(3pm)				User Contributed Perl Documentation			       Log::Report::Exception(3pm)

NAME
Log::Report::Exception - a collected report SYNOPSIS
# created within a try block try { error "help!" }; my $exception = $@->wasFatal; $exception->throw if $exception; $@->reportFatal; # combination of above two lines my $message = $exception->message; # the Log::Report::Message if($message->inClass('die')) ... if($exception->inClass('die')) ... # same if($@->wasFatal(class => 'die')) ... # same DESCRIPTION
In Log::Report, exceptions are not as extended as available in languages as Java: you do not create classes for them. The only thing an exception object does, is capture some information about an (untranslated) report. METHODS
Constructors Log::Report::Exception->new(OPTIONS) -Option --Default message <required> reason <required> report_opts {} message => Log::Report::Message reason => REASON report_opts => HASH Accessors $obj->isFatal Returns whether this exception has a severity which makes it fatal when thrown. See Log::Report::isFatal(). example: if($ex->isFatal) { $ex->throw(reason => 'ALERT') } else { $ex->throw } $obj->message([MESSAGE]) Change the MESSAGE of the exception, must be a Log::Report::Message object. When you use a "Log::Report::Message" object, you will get a new one returned. Therefore, if you want to modify the message in an exception, you have to re-assign the result of the modification. example: $e->message->concat('!!')); # will not work! $e->message($e->message->concat('!!')); $e->message(__x"some message {msg}", msg => $xyz); $obj->reason([REASON]) $obj->report_opts Processing $obj->inClass(CLASS|REGEX) Check whether any of the classes listed in the message match CLASS (string) or the REGEX. This uses Log::Report::Message::inClass(). $obj->print([FILEHANDLE]) The default filehandle is STDOUT. example: print $exception; # via overloading $exception->print; # OO style $obj->throw(OPTIONS) Insert the message contained in the exception into the currently defined dispatchers. The "throw" name is commonly known exception related terminology for "report". The OPTIONS overrule the captured options to Log::Report::report(). This can be used to overrule a destination. Also, the reason can be changed. example: overrule defaults to report try { print {to => 'stderr'}, ERROR => 'oops!' }; $@->reportFatal(to => 'syslog'); $exception->throw(to => 'syslog'); $@->wasFatal->throw(reason => 'WARNING'); $obj->toString Prints the reason and the message. Differently from throw(), this only represents the textual content: it does not re-cast the exceptions to higher levels. example: printing exceptions print $_->toString for $@->exceptions; print $_ for $@->exceptions; # via overloading OVERLOADING
overload: stringification Produces "reason: message". SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Exception(3pm)
Man Page