NAME

OpenGbg::Exception::BadResponseFromService

VERSION

Version 0.1301, released 2015-01-16.

SYNOPSIS

use Safe::Isa;
use Try::Tiny:
my $handler = OpenGbg->new(key => 'secret-api-key');

my $response;
try {
    $response = $handler->styr_och_stall->get_bike_stations;
}
catch {
    my $error = $_;
    if($error->$_does('OpenGbg::Exception')) {
        $error->out;
    }
    else {
        die $_;
    }
};

DESCRIPTION

OpenGbg::Exception::BadResponseFromService is thrown when http calls to web services fail. It does OpenGbg::Execption.

NAME

OpenGbg::Exception::BadResponseFromService - When http fails

ATTRIBUTES

service

The name of the service that was called (eg. OpenGbg::Service::StyrOchStall::get_bike_stations).

url

String. The responding url.

status

String. The http error code.

reason

String. The http error message.

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT

Copyright 2014 - Erik Carlsson

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SOURCE

https://github.com/Csson/p5-OpenGbg

HOMEPAGE

https://metacpan.org/release/OpenGbg

AUTHOR

Erik Carlsson <info@code301.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Erik Carlsson.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.