diff --git a/Changes b/Changes index 6c591501..5cfadea0 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Perl module Mojo::WebSocketProxy {{$NEXT}} + Add warning with transaction details failure, if available. 0.06 2017-06-01 03:05:17+00:00 UTC This introduces support for callbacks which return Future instances, diff --git a/lib/Mojo/WebSocketProxy/CallingEngine.pm b/lib/Mojo/WebSocketProxy/CallingEngine.pm index 092fbd60..44ffb2e5 100644 --- a/lib/Mojo/WebSocketProxy/CallingEngine.pm +++ b/lib/Mojo/WebSocketProxy/CallingEngine.pm @@ -144,7 +144,12 @@ sub call_rpc { my $api_response; if (!$res) { - warn "WrongResponse [$msg_type]"; + my $tx = $client->tx; + my $details = 'URL: ' . $tx->req->url; + if (my $err = $tx->error) { + $details .= ', code: ' . ($err->{code} // 'n/a') . ', response: ' . $err->{message}; + } + warn "WrongResponse [$msg_type], details: $details"; $api_response = $c->wsp_error($msg_type, 'WrongResponse', 'Sorry, an error occurred while processing your request.'); $c->send({json => $api_response}, $req_storage); return;