CGI::Session::ErrorHandler - error handling routines for CGI::Session
| Use Case | Command | Description |
|---|---|---|
| Set an error message | $self->set_error("message") | Sets the error message and returns undef |
| Retrieve the last error | $self->errstr() | Returns the last error message or empty string |
require CGI::Session::ErrorHandler;
@ISA = qw( CGI::Session::ErrorHandler );
sub some_method {
my $self = shift;
unless ( $some_condition ) {
return $self->set_error("some_method(): \$some_condition isn't met");
}
}
CGI::Session::ErrorHandler provides set_error() and errstr() methods for setting and accessing error messages from within CGI::Session's components. This method should be used by driver developers for providing CGI::Session-standard error handling routines for their code.
set_error($message) — Implicitly defines $pkg_name::errstr and sets its value to $message. Return value is always undef.errstr() — Returns whatever value was set by the most recent call to set_error(). If no message has been set yet, the empty string is returned so the message can still concatenate without a warning.For support and licensing information see CGI::Session.
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-08 12:31 @216.73.216.150
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format