error_xml - Convert 500 errors to XML and process through XSLT
Plugin error_xml ErrorStylesheet /path/to/error.xsl # optional StackTrace On
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.
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>
An XSLT stylesheet to use for transforming the error XML to HTML.
Takes a boolean value (to the extreme!) to determine whether to include a stack trace in the output or not.
Takes a boolean value to determine whether to output the stack trace to the log as well as the browser.
To install AxKit2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AxKit2
CPAN shell
perl -MCPAN -e shell install AxKit2
For more information on module installation, please visit the detailed CPAN module installation guide.