---
name: "CGI::Session::ErrorHandler"
section: "3pm"
platform: "linux"
package: "perl-cgi-session"
version: "4.49-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/CGI::Session::ErrorHandler"
---

# CGI::Session::ErrorHandler(3pm)

error handling routines for CGI::Session

## NAME

CGI::Session::ErrorHandler - error handling routines for CGI::Session

## SYNOPSIS

```
    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");
        }
    }
```

## DESCRIPTION

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

### METHODS

- 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 as has been set yet, the empty string is returned so the message can still concatenate without a warning.

## LICENSING

For support and licensing information see CGI::Session.
