Gerrit::REST::Exception - Exception class for Gerrit::REST errors
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:
The HTTP numeric error code.
The HTTP response contents.
Read Gerrit::REST documentation to know how to use it.
use Gerrit::REST::Exception; # ... die Gerrit::REST::Exception->new($code, $content_type, $content);
If the constructor receives one argument it must be a string content. In this case, the
code is assumed to be 500 and the
type to be
If the constructor receives three arguments they are: the
Content-Type, and the
content of the REST HTTP error message.
This method stringifies the object like this:
The contents are converted to text if possible.
Gustavo L. de M. Chaves <firstname.lastname@example.org>
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.