LEGAL

#===========================================================================

Copyright (C) 2008 by Nik Ogura. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Bug reports and comments to nik.ogura@gmail.com.

#===========================================================================

NAME

CGI::Lazy::ErrorHandler

SYNOPSIS

        use CGI::Lazy;

        my $q = CGI::Lazy->new('/path/to/config/');

        ...

        if ($q->errorHandler->errors) {
                print STDERR "ARRGH! $_\n" for $q->errorHandler->errors;
        }

DESCRIPTION The error handler gathers up all error messages produced by the Lazy's internals. It has, at present, one really useful method: errors, which returns the array of error messages encountered in the execution of the request. It returns an array, so you can use it in an if or unless to check for errors. If it returns false, then no errors were encountered. No news is good news. For convenience sake, the errorref method is available to return a reference to the errors array.

By default, any errors triggered are printed to STDERR. If you wish to disable this feature, set silent => 1 in the main lazy config.

METHODS

errors ()

Returns array of error messages produced by the request.

errorref ()

Returns array ref to array of error messages produced by the request.