Opsview::REST::Exception - Structured exceptions for Opsview::REST
my $e = Opsview::REST::Exception->new( status => 404, reason => "Not Found", message => "The method called doesn't exist", ); croak $e; # To inspect the exception from your code my $ops = Opsview::REST->new( ... ); eval { $ops->get('/rest_api_method'); }; if ($@) { warn $@->status; warn $@->reason; warn $@->message; }
This is a convenience object to throw exceptions from within Opsview::REST modules.
message is not guaranteed to be defined in every exception
Miquel Ruiz <mruiz@cpan.org>
This software is copyright (c) 2012 by Miquel Ruiz.
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 Opsview::REST, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Opsview::REST
CPAN shell
perl -MCPAN -e shell install Opsview::REST
For more information on module installation, please visit the detailed CPAN module installation guide.