Brian Phillips > WebService-Shutterstock-0.004 > WebService::Shutterstock::Exception

Download:
WebService-Shutterstock-0.004.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.004   Source   Latest Release: WebService-Shutterstock-0.006

NAME ^

WebService::Shutterstock::Exception - Exception object to allow for easy error handling on HTTP errors

VERSION ^

version 0.004

SYNOPSIS ^

        # better safe than sorry
        try {
                my $license = $customer->license($image_id)
                $license->save('/path/to/my/photos');
        } catch {
                my $error = $_;
                # handle error...
        };

DESCRIPTION ^

This class provides more context for an error message than just a simple string (although it stringifies to make it act like your typical $@ value).

ATTRIBUTES ^

request

The HTTP::Request object for the API request that died.

response

The HTTP::Response object for the API request that died.

error

String error message. Often, the body of the HTTP response that errored out.

caller_info

A HashRef of information (package, file, line) of where this exception originated (in non-WebService-Shutterstock land).

METHODS ^

to_string

Stringifies to error message, used by overloaded stringification.

AUTHOR ^

Brian Phillips <bphillips@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Brian Phillips and Shutterstock, Inc. (http://shutterstock.com).

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: