From: Nicolas Boisselier Date: Wed, 14 Dec 2016 14:08:42 +0000 (+0100) Subject: ovh-api X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=522296ff38cef1da3907eb81d778e71e611d3ed0;p=nb.git ovh-api --- diff --git a/bin/ovh-api b/bin/ovh-api index 142e85a5..3a685b27 100755 --- a/bin/ovh-api +++ b/bin/ovh-api @@ -80,8 +80,8 @@ $BODY = -e $BODY ? JSON::decode_json(`cat $BODY`) : JSON::encode_json($BODY) if #use Data::Dumper; die Dumper($BODY); my $response = $o->rawCall(path=>$URL,method=>$Opt{method},body=>$BODY); -if (!$response) { - die "$NAME: $URL failed!" +if ($response->isFailure()) { + die "$NAME: ".$response->error()."\n"; } my $content = $response->content;