BZ-Client
view release on metacpan or search on metacpan
lib/BZ/Client/Exception.pm view on Meta::CPAN
=head2 message
Returns the error message text
=head2 xmlrpc_code
Returns the error code from XMLRPC
=head2 http_code
Returns the http code (200, 404, etc)
=head1 EXAMPLE
Here are two examples. The first uses Perl's inbuilt eval() function, the
second uses the Try::Tiny module. Further alternatives exist and may be
perfectly good options if they suit you.
=head2 eval
use BZ::Client;
lib/BZ/Client/XMLRPC.pm view on Meta::CPAN
print $fh "\n";
print $fh $res->{content} if $res->{content};
close($fh);
}
}
if (!$res->{success}) {
my $code = $res->{status};
if ($code == 401) {
$self->error('Authorization error, perhaps invalid user name and/or password', $code);
}
elsif ($code == 404) {
$self->error('Bugzilla server not found, perhaps invalid URL.', $code);
}
else {
my $msg = $res->{reason};
$msg .= ' : ' . $res->{content} if $res->{content};
$self->error("Unknown error: $msg", $code);
}
}
return $response
( run in 0.868 second using v1.01-cache-2.11-cpan-39bf76dae61 )