| 1 | package AnyEvent::XMPP::Error::IQ; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | no warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 0 | ▶ | use AnyEvent::XMPP::Error::Stanza; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 5 | our @ISA = qw/AnyEvent::XMPP::Error::Stanza/; | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | AnyEvent::XMPP::Error::IQ - IQ errors | ||
| 10 | |||
| 11 | Subclass of L<AnyEvent::XMPP::Error::Stanza> | ||
| 12 | |||
| 13 | =cut | ||
| 14 | |||
| 15 | sub init { | ||
| 16 | my ($self) = @_; | ||
| 17 | my $node = $self->xml_node; | ||
| 18 | |||
| 19 | unless (defined $node) { | ||
| 20 | $self->{error_cond} = 'client-timeout'; | ||
| 21 | $self->{error_type} = 'cancel'; | ||
| 22 | return; | ||
| 23 | } | ||
| 24 | |||
| 25 | $self->SUPER::init; | ||
| 26 | } | ||
| 27 | |||
| 28 | =head2 METHODS | ||
| 29 | |||
| 30 | =over 4 | ||
| 31 | |||
| 32 | =item B<condition ()> | ||
| 33 | |||
| 34 | Same as L<AnyEvent::XMPP::Error::Stanza> except that | ||
| 35 | in case of a IQ timeout it returns: | ||
| 36 | |||
| 37 | 'client-timeout' | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | sub string { | ||
| 42 | my ($self) = @_; | ||
| 43 | |||
| 44 | sprintf "iq error: %s/%s (type %s): %s", | ||
| 45 | $self->code || '', | ||
| 46 | $self->condition || '', | ||
| 47 | $self->type, | ||
| 48 | $self->text | ||
| 49 | } | ||
| 50 | |||
| 51 | =back | ||
| 52 | |||
| 53 | =cut | ||
| 54 | |||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >> | ||
| 59 | |||
| 60 | =head1 COPYRIGHT & LICENSE | ||
| 61 | |||
| 62 | Copyright 2007, 2008 Robin Redeker, all rights reserved. | ||
| 63 | |||
| 64 | This program is free software; you can redistribute it and/or modify it | ||
| 65 | under the same terms as Perl itself. | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | 1; # End of AnyEvent::XMPP | ||