Add debug for api errors
This commit is contained in:
@@ -13,7 +13,7 @@ use English qw ( -no_match_vars );
|
|||||||
use Mojo::IOLoop ();
|
use Mojo::IOLoop ();
|
||||||
use Mojo::JSON qw (true false);
|
use Mojo::JSON qw (true false);
|
||||||
use Mojo::UserAgent ();
|
use Mojo::UserAgent ();
|
||||||
use Carp qw/croak cluck confess/; # use croak where we return error up to app that supply something wrong
|
use Carp qw/carp croak cluck confess/; # use croak where we return error up to app that supply something wrong
|
||||||
# use cluck where we want to say that something bad but non-critical happen in
|
# use cluck where we want to say that something bad but non-critical happen in
|
||||||
# lower layer (Mojo loop)
|
# lower layer (Mojo loop)
|
||||||
# use confess where we want to say that fatal error happen in lower layer (Mojo loop)
|
# use confess where we want to say that fatal error happen in lower layer (Mojo loop)
|
||||||
@@ -743,7 +743,14 @@ sub _post_request {
|
|||||||
}
|
}
|
||||||
elsif ($res->is_error) {
|
elsif ($res->is_error) {
|
||||||
# This can be non-fatal error: api change.
|
# This can be non-fatal error: api change.
|
||||||
cluck 'Failed to post: ' . $res->message;
|
#cluck 'Failed to post: ' . $res->message;
|
||||||
|
carp 'Failed to post to: ' . $res->message;
|
||||||
|
carp sprintf (
|
||||||
|
"Input parameters: %s\nResonse Dump: %s\nURL:%s\n",
|
||||||
|
Dumper ($form_args),
|
||||||
|
Dumper ($res),
|
||||||
|
$url,
|
||||||
|
);
|
||||||
return 0; # to handle this as false in upper layers
|
return 0; # to handle this as false in upper layers
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user