Matt Sergeant > AxKit2-1.1 > error_xml

Download:
AxKit2-1.1.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

error_xml - Convert 500 errors to XML and process through XSLT

SYNOPSIS ^

  Plugin error_xml
  ErrorStylesheet /path/to/error.xsl
  # optional
  StackTrace On

DESCRIPTION ^

This plugin turns AxKit exceptions into XML structures to be transformed via XSLT and output to the browser. Simply specify an error.xsl to transform with, or use the one provided with AxKit (in demo/error.xsl).

If you wish to include a full stack trace, add the config as listed below.

Note: This plugin does add some overhead so it is suggested to only use it in development.

FORMAT ^

The error XML is in the following format:

  <?xml version="1.0"?>
  <error>
    <file>./plugins/foosle</file>
    <msg>Can't locate object method "foobar" via package 
      "AxKit2::Plugin::foosle" at ./plugins/foosle line 37.
    </msg>
    <stack_trace>
      <bt level="0">
        <package>AxKit2::Plugin::foosle</package>
        <file>./plugins/foosle</file>
        <line>37</line>
        <subroutine>AxKit2::Plugin::error_xml::__ANON__(...)</subroutine>
      </bt>
      <bt level="1">
        <package>AxKit2::Plugin</package>
        <file>lib/AxKit2/Plugin.pm</file>
        <line>35</line>
        <subroutine>AxKit2::Plugin::foosle::hook_xmlresponse(...)</subroutine>
      </bt>
      ...
    </stacktrace>
  </error>

CONFIG ^

ErrorStylesheet STRING

An XSLT stylesheet to use for transforming the error XML to HTML.

StackTrace ( On | Off | 1 | 0 | Yes | No )

Takes a boolean value (to the extreme!) to determine whether to include a stack trace in the output or not.

StackTraceLog ( On | Off | 1 | 0 | Yes | No )

Takes a boolean value to determine whether to output the stack trace to the log as well as the browser.

syntax highlighting: