| 1 |
elmex |
1.1 |
package Net::XMPP2::Error; |
| 2 |
|
|
use strict; |
| 3 |
|
|
use Net::XMPP2::Util qw/stringprep_jid prep_bare_jid/; |
| 4 |
|
|
use Net::XMPP2::Error; |
| 5 |
elmex |
1.8 |
use Net::XMPP2::Error::SASL; |
| 6 |
|
|
use Net::XMPP2::Error::IQ; |
| 7 |
|
|
use Net::XMPP2::Error::Register; |
| 8 |
|
|
use Net::XMPP2::Error::Stanza; |
| 9 |
elmex |
1.10 |
use Net::XMPP2::Error::Stream; |
| 10 |
elmex |
1.8 |
use Net::XMPP2::Error::Presence; |
| 11 |
|
|
use Net::XMPP2::Error::Message; |
| 12 |
elmex |
1.11 |
use Net::XMPP2::Error::Parser; |
| 13 |
elmex |
1.12 |
use Net::XMPP2::Error::Exception; |
| 14 |
elmex |
1.1 |
|
| 15 |
|
|
=head1 NAME |
| 16 |
|
|
|
| 17 |
elmex |
1.9 |
Net::XMPP2::Error - Error class hierarchy for error reporting |
| 18 |
elmex |
1.1 |
|
| 19 |
|
|
=head1 SYNOPSIS |
| 20 |
|
|
|
| 21 |
|
|
die $error->string; |
| 22 |
|
|
|
| 23 |
|
|
=head1 DESCRIPTION |
| 24 |
|
|
|
| 25 |
|
|
This module is a helper class for abstracting any kind |
| 26 |
|
|
of error that occurs in Net::XMPP2. |
| 27 |
|
|
|
| 28 |
|
|
You receive instances of these objects by various events. |
| 29 |
|
|
|
| 30 |
|
|
=cut |
| 31 |
|
|
|
| 32 |
|
|
sub new { |
| 33 |
|
|
my $this = shift; |
| 34 |
|
|
my $class = ref($this) || $this; |
| 35 |
|
|
my $self = bless { @_ }, $class; |
| 36 |
|
|
$self->init; |
| 37 |
|
|
$self |
| 38 |
|
|
} |
| 39 |
|
|
|
| 40 |
|
|
sub init { } |
| 41 |
|
|
|
| 42 |
|
|
=head1 SUPER CLASS |
| 43 |
|
|
|
| 44 |
|
|
Net::XMPP2::Error - The super class of all errors |
| 45 |
|
|
|
| 46 |
|
|
=head2 METHODS |
| 47 |
|
|
|
| 48 |
|
|
These methods are implemented by all subclasses. |
| 49 |
|
|
|
| 50 |
elmex |
1.7 |
=over 4 |
| 51 |
|
|
|
| 52 |
|
|
=item B<string ()> |
| 53 |
elmex |
1.1 |
|
| 54 |
|
|
Returns a humand readable string for this error. |
| 55 |
|
|
|
| 56 |
|
|
=cut |
| 57 |
|
|
|
| 58 |
|
|
sub string { |
| 59 |
|
|
my ($self) = @_; |
| 60 |
|
|
$self->{text} |
| 61 |
|
|
} |
| 62 |
|
|
|
| 63 |
elmex |
1.7 |
=back |
| 64 |
|
|
|
| 65 |
elmex |
1.1 |
=head1 AUTHOR |
| 66 |
|
|
|
| 67 |
elmex |
1.7 |
Robin Redeker, C<< <elmex at ta-sa.org> >>, JID: C<< <elmex at jabber.org> >> |
| 68 |
elmex |
1.1 |
|
| 69 |
|
|
=head1 COPYRIGHT & LICENSE |
| 70 |
|
|
|
| 71 |
|
|
Copyright 2007 Robin Redeker, all rights reserved. |
| 72 |
|
|
|
| 73 |
|
|
This program is free software; you can redistribute it and/or modify it |
| 74 |
|
|
under the same terms as Perl itself. |
| 75 |
|
|
|
| 76 |
|
|
=cut |
| 77 |
|
|
|
| 78 |
|
|
1; # End of Net::XMPP2 |