Miquel Ruiz Martin > Opsview-REST-0.011 > Opsview::REST::Exception

Download:
Opsview-REST-0.011.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.011   Source   Latest Release: Opsview-REST-0.013

NAME ^

Opsview::REST::Exception - Structured exceptions for Opsview::REST

SYNOPSIS ^

    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;
    }

DESCRIPTION ^

This is a convenience object to throw exceptions from within Opsview::REST modules.

ATTRIBUTES ^

status

reason

message

message is not guaranteed to be defined in every exception

AUTHOR ^

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: