
ASP4::Error - Representation of a server-side error

use ASP4::Error;
# Pass in the $@ value after something dies or confesses:
eval { die "Foo" };
if( $@ ) {
my $error = ASP4::Error->new( $@ )
}
# Pass in your own info:
unless( $something ) {
my $error = ASP4::Error->new(
message => "If can, can. If no can, no can!"
);
}

ASP4 provides a simple means of dealing with errors. It emails them, by default, to an email address you specify.
Sometimes that is not convenient. Maybe you want to do something special with the error - like log it someplace special.
ASP4::Error is a simple representation of a server-side error.

<$Config-errors->domain>> or $ENV{HTTP_HOST}
$ENV{REQUEST_URI}
The name of the file in which the error occurred. This is gleaned from $@ unless file is passed to the constructor.
The line number within the file that the error occurred. This is gleaned from $@ unless line is passed to the constructor.
A string. Includes the 5 lines of code before and after the line of code where the error occurred.
Defaults to the first part of $@ unless otherwise specified.
A string - defaults to the value of $@.
JSON-encoded $Form object.
JSON-encoded $Session object.
Default value is $ENV{HTTP_REFERER}
Default value is $ENV{HTTP_USER_AGENT}
The current value of <$Response-Status>>
Default value is $ENV{REMOTE_ADDR} -- the IP address of the remote client.

It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=ASP4 to submit bug reports.

Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.