NAME
Gerrit::REST::Exception - Exception class for Gerrit::REST errors
VERSION
version 0.008
DESCRIPTION
This is an auxiliary class for the Gerrit::REST distribution. It's used by Gerrit::REST methods to throw exceptions when they get some error code from Gerrit itself, during a REST call. The Gerrit::REST::Exception objects are simple hash-refs containing the following information taken from the REST HTTP response:
code
The HTTP numeric error code.
type
The HTTP
Content-Type
.content
The HTTP response contents.
Read Gerrit::REST documentation to know how to use it.
SYNOPISIS
use Gerrit::REST::Exception;
# ...
die Gerrit::REST::Exception->new($code, $content_type, $content);
METHODS
new CODE, TYPE, CONTENT
The constructor needs three arguments: the code
, the Content-Type
, and the content
of the REST HTTP error message.
as_text
This method stringifies the object like this:
Gerrit::REST::Exception[<code>]: <content>
The contents are converted to text if possible.
AUTHOR
Gustavo L. de M. Chaves <gnustavo@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by CPqD <www.cpqd.com.br>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.