John Drago

NAME

ASP4::ErrorHandler::Remote - Send your errors someplace else via http.

SYNOPSIS

In your asp4-config.json:

  ...
    "errors": {
      "error_handler":    "ASP4::ErrorHandler::Remote",
      "post_errors_to":   "http://errors.ohno.com/post/errors/here/"
    },
  ...

DESCRIPTION

This class provides a default error handler which does the following:

1) Makes a simple HTML page and prints it to the browser, telling the user that an error has just occurred.

2) Sends an error notification to the web address specified in the config.

The data contained within the POST will match the public properties of ASP4::Error, like this:

  $VAR1 = {
            'remote_addr' => '127.0.0.1',
            'request_uri' => '/',
            'user_agent' => 'test-useragent v2.0',
            'file' => '/home/john/Projects/myapp/www/htdocs/index.asp',
            'session_data' => '{}',
            'message' => 'A fake error has occurred',
            'http_code' => '500',
            'stacktrace' => 'A fake error has occurred at /tmp/PAGE_CACHE/TSR_WWW/__index_asp.pm line 2.
  ',
            'domain' => 'www.tsr.local',
            'form_data' => '{}',
            'http_referer' => '',
            'code' => 'line 1: <h1>Hello, world!</h1>
  line 2: <%
  line 3:   die "A fake error has occurred";
  line 4: %>
  ',
            'line' => '2'
  };

PUBLIC METHODS

send_error( $error )

Sends the error data to the web address specified in <$Config-errors->post_errors_to>>.

The field names and values will correspond to the properties of an ASP4::Error object.

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.

AUTHOR

John Drago <jdrago_999@yahoo.com>

COPYRIGHT

Copyright 2008 John Drago. All rights reserved.

LICENSE

This software is Free software and is licensed under the same terms as perl itself.