File: Exception.pm

package info (click to toggle)
libanyevent-xmpp-perl 0.55-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 784 kB
  • ctags: 553
  • sloc: perl: 8,004; makefile: 13
file content (55 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package AnyEvent::XMPP::Error::Exception;
use AnyEvent::XMPP::Error;
use strict;
our @ISA = qw/AnyEvent::XMPP::Error/;

=head1 NAME

AnyEvent::XMPP::Error::Exception - Some exception was thrown somewhere

Subclass of L<AnyEvent::XMPP::Error>

=head2 METHODS

=over 4

=item B<exception>

This returns the exception object that was thrown in C<$@>.

=cut

sub exception { $_[0]->{exception} }

=item B<context>

This returns a string which describes the context in which this exception
was thrown

=cut

sub context   { $_[0]->{context} }

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

   sprintf "exception in context '%s': %s",
      $self->context, $self->exception
}

=back

=head1 AUTHOR

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

=head1 COPYRIGHT & LICENSE

Copyright 2007, 2008 Robin Redeker, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

1; # End of AnyEvent::XMPP