XMPP/Error.pm

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