Gerrit::REST::Exception - Exception class for Gerrit::REST errors
version 0.009
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-Type
content
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 text/plain.
text/plain
If the constructor receives three arguments they are: the code, the Content-Type, and the content of the REST HTTP error message.
This method stringifies the object like this:
Gerrit::REST::Exception[<code>]: <content>
The contents are converted to text if possible.
Gustavo L. de M. Chaves <gnustavo@cpan.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.
To install Gerrit::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gerrit::REST
CPAN shell
perl -MCPAN -e shell install Gerrit::REST
For more information on module installation, please visit the detailed CPAN module installation guide.