=head1 NAME

Log::Report::Exception - a collected report

=head1 INHERITANCE

=head1 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

=head1 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.

=head1 METHODS

=head2 Constructors

Log::Report::Exception-E<gt>B<new>(OPTIONS)

=over 4

 Option     --Default
 message      <required>
 reason       <required>
 report_opts  {}

. message => Log::Report::Message

. reason => REASON

. report_opts => HASH

=back

=head2 Accessors

$obj-E<gt>B<message>

=over 4

=back

$obj-E<gt>B<reason>

=over 4

=back

$obj-E<gt>B<report_opts>

=over 4

=back

=head2 Processing

$obj-E<gt>B<inClass>(CLASS|REGEX)

=over 4

Check whether any of the classes listed in the message match CLASS
(string) or the REGEX.  This uses L<Log::Report::Message::inClass()|Log::Report::Message/"Processing">.

=back

$obj-E<gt>B<throw>(OPTIONS)

=over 4

Insert the message contained in the exception into the currently
defined dispatchers.  The C<throw> name is commonly known
exception related terminology for C<report>.

The OPTIONS overrule the captured options to L<Log::Report::report()|Log::Report/"Report Production and Configuration">.
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');

=back

=head1 SEE ALSO

This module is part of Log-Report distribution version 0.23,
built on April 24, 2009. Website: F<http://perl.overmeer.net/log-report/>

=head1 LICENSE

Copyrights 2007-2009 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 F<http://www.perl.com/perl/misc/Artistic.html>

