---
name: "POE::Component::Jabber::Error"
section: "3pm"
platform: "linux"
package: "libpoe-component-jabber-perl"
version: "2.02-1"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/POE::Component::Jabber::Error"
---

# POE::Component::Jabber::Error(3pm)

Error constants for use in PCJ

## NAME

POE::Component::Jabber::Error - Error constants for use in PCJ

## SYNOPSIS

```
 use POE::Component::Jabber::Error; # All constants imported
```

```
 sub error_handler()
 {
        my $error = $_[ARG0];
```

```
        if($error == +PCJ_SOCKETFAIL)
        {
                my ($call, $code, $err) = @_[ARG1..ARG3];
                print "Socket error: $call, $code, $err\n";
```

```
        } elsif ($error == +PCJ_SOCKETDISCONNECT) {
```

```
                print "We got disconneted\n";
```

```
        } elsif ($error == +PCJ_CONNECTFAIL) {
```

```
                print "We failed to connect\n";
```

```
        } elsif ($error == +PCJ_AUTHFAIL) {
```

```
                print "Failed to authenticate\n";
```

```
        } elsif ($error == +PCJ_BINDFAIL) {
```

```
                print "Failed to bind a resource\n"; # XMPP/J2 Only
```

```
        } elsif ($error == +PCJ_SESSIONFAIL) {
```

```
                print "Failed to establish a session\n"; # XMPP Only
```

```
        } elsif ($error == +PCJ_SSLFAIL) {
```

```
                my $err = @_[+ARG1];
                print "TLS/SSL negotiation failed: $err\n"; #XMPP/J2 only
        }
 }
```

## DESCRIPTION

POE::Component::Jabber::Error provides error constants for use in error handlers to determine the type of error one of the Client classes encountered.

Simply \`use\`ing the class imports all of the constants

## ERRORS

- PCJ\_SOCKETFAIL

  There has been some sort of socket error. ARG1..ARG3 are what  the POE::Wheel::ReadWrite gave to us.

  See POE::Wheel::ReadWrite for further details on what is returned.

- PCJ\_SOCKETDISCONNECT

  The socket has been disconnected.

- PCJ\_CONNECTFAIL

  Failed to establish a TCP connection.

- PCJ\_AUTHFAIL

  Authentication has failed.

- PCJ\_BINDFAIL

  Resource/Domain binding has failed. XMPP/J2 Only

- PCJ\_SESSIONFAIL

  Session establishment has failed. XMPP Only

- PCJ\_SSLFAIL

  TLS/SSL negotiation has failed. ARG1 is what POE::Component::SSLify sets to $@ for your ever delightful information. XMPP/J2 Only

## NOTES

These errors aren't written in stone. They are written in vim. They are subject to change.

## AUTHORS AND COPYRIGHT

Copyright (c) 2004 - 2007 Nicholas Perez. Released and distributed under the GPL.
