AnyEvent::XMPP::Error::IQ - IQ errors


AnyEvent-XMPP documentation Contained in the AnyEvent-XMPP distribution.

Index


Code Index:

NAME

Top

AnyEvent::XMPP::Error::IQ - IQ errors

Subclass of AnyEvent::XMPP::Error::Stanza

METHODS

condition ()

Same as AnyEvent::XMPP::Error::Stanza except that in case of a IQ timeout it returns:

   'client-timeout'

AUTHOR

Top

Robin Redeker, <elmex at ta-sa.org>, JID: <elmex at jabber.org>

COPYRIGHT & LICENSE

Top


AnyEvent-XMPP documentation Contained in the AnyEvent-XMPP distribution.
package AnyEvent::XMPP::Error::IQ;
use strict;
no warnings;
use AnyEvent::XMPP::Error::Stanza;
our @ISA = qw/AnyEvent::XMPP::Error::Stanza/;

sub init {
   my ($self) = @_;
   my $node = $self->xml_node;

   unless (defined $node) {
      $self->{error_cond} = 'client-timeout';
      $self->{error_type} = 'cancel';
      return;
   }

   $self->SUPER::init;
}

sub string {
   my ($self) = @_;

   sprintf "iq error: %s/%s (type %s): %s",
      $self->code || '',
      $self->condition || '',
      $self->type,
      $self->text
}

1; # End of AnyEvent::XMPP