WWW::Yahoo::Briefcase::Exceptions - exceptions related to briefcase access |
WWW::Yahoo::Briefcase::Exceptions - exceptions related to briefcase access
require WWW::Yahoo::Briefcase; eval { something }; if ( ref $@ ) { if ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::Usage' ) ) { die "Usage error: $@\n"; } elsif ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::Signin' ) ) { die "Signin error: $@\n"; } elsif ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::Server' ) ) { die "Server error: $@\n"; } elsif ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::Interface' ) ) { die "Interface error: $@\n"; } elsif ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::File' ) ) { die "File error: $@\n"; } elsif ( $@->isa( 'WWW::Yahoo::Briefcase::Exception::List' ) ) { die "Multiple errors: $@\n"; } } die $@ if $@;
This module defines several classes of exceptions as described below.
Incorrect or invalid usage of method parameters. Note that a full stack trace will be printed when this exception is stringified to help you find out where the mistake occurred. To disable the stack trace, include this line somewhere after ``require WWW::Yahoo::Briefcase'':
WWW::Yahoo::Briefcase::Exception::Usage->Trace(0);
Invalid userid, password, or cookie.
Yahoo returned a server error for an HTTP request. The request and response are available as fields of this exception, for example,
eval { something }; if ( $@ and $@->isa( 'WWW::Yahoo::Briefcase::Exception::Server' ) ) { my $request_line = $@->request->method . ' ' . $@->request->uri; my $status_line = $@->response->status_line; }
Yahoo returned an unexpected response to an HTTP request.
Problem accessing a local file.
Holds a list of errors, which can be accessed via the errors method:
eval { something }; if ( $@ and $@->isa( 'WWW::Yahoo::Briefcase::Exception::List' ) ) { foreach my $error ( $@->errors ) { warn $error->message . "\n" . $error->trace->as_string . "\n"; warn "------------------------------------\n"; } exit; }
WWW::Yahoo::Briefcase, WWW::Yahoo::Briefcase::File, Exception::Class
Ken Neighbors, Ph.D. ken@nsds.com
Copyright 2003 by Ken Neighbors
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.000 or (at your option) any later version of Perl. That is, you can redistribute this module and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or
b) the "Artistic License" which comes with Perl, or
c) the license terms of Perl versions later than 5.000
WWW::Yahoo::Briefcase::Exceptions - exceptions related to briefcase access |