CGI::Lazy::ErrorHandler - CGI::Lazy::ErrorHandler documentation


CGI-Lazy documentation  | view source Contained in the CGI-Lazy distribution.

Index


LEGAL

Top

NAME

Top

CGI::Lazy::ErrorHandler

SYNOPSIS

Top

	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.

Top

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

Top

errors ()

Returns array of error messages produced by the request.

errorref ()

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


CGI-Lazy documentation  | view source Contained in the CGI-Lazy distribution.