NAME
ASP4::Error - Representation of a server-side error
SYNOPSIS
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!"
);
}
DESCRIPTION
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.
PUBLIC READ-ONLY PROPERTIES
domain
<$Config-
errors->domain>> or $ENV{HTTP_HOST}
request_uri
$ENV{REQUEST_URI}
file
The name of the file in which the error occurred. This is gleaned from $@
unless file
is passed to the constructor.
line
The line number within the file that the error occurred. This is gleaned from $@
unless line
is passed to the constructor.
code
A string. Includes the 5 lines of code before and after the line of code where the error occurred.
message
Defaults to the first part of $@
unless otherwise specified.
stacktrace
A string - defaults to the value of $@
.
form_data
JSON-encoded $Form
object.
session_data
JSON-encoded $Session
object.
http_referer
Default value is $ENV{HTTP_REFERER}
user_agent
Default value is $ENV{HTTP_USER_AGENT}
http_code
The current value of <$Response-
Status>>
remote_addr
Default value is $ENV{REMOTE_ADDR}
-- the IP address of the remote client.
BUGS
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.
HOMEPAGE
Please visit the ASP4 homepage at http://0x31337.org/code/ to see examples of ASP4 in action.