METHODS

Constructors

$class->new( OPTIONS )
Option Default

message

<required>

reason

<required>

report_opts

{}

message => Log::Report::Message
reason => REASON
report_opts => HASH

Accessors

$obj->message
$obj->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->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');
$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