X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fgraphql-client;a=blobdiff_plain;f=lib%2FGraphQL%2FClient%2Fhttp.pm;fp=lib%2FGraphQL%2FClient%2Fhttp.pm;h=77a089f2e319b5f3627ac31c1a9ceac3407fede2;hp=796e3809bd56e3ecb09280feda0ef393561ab61f;hb=1a966ff0db27d934fce36e2bd43ea6aace0a7555;hpb=2c3b4020da88b3cf2f968e0b2c4e7b1a7e24a35f diff --git a/lib/GraphQL/Client/http.pm b/lib/GraphQL/Client/http.pm index 796e380..77a089f 100644 --- a/lib/GraphQL/Client/http.pm +++ b/lib/GraphQL/Client/http.pm @@ -90,6 +90,8 @@ sub _handle_error { my $reason = $resp->{reason} // ''; my $message = "HTTP transport returned $resp->{status} ($reason): $content"; + chomp $message; + return { error => $message, response => $data, @@ -201,8 +203,8 @@ See L. Get a response from the GraphQL server. -The C<%data> structure must have a C key whose value is the query or mutation string. It may -optionally have a C hashref and an C string. +The C<%request> structure must have a C key whose value is the query or mutation string. It +may optionally have a C hashref and an C string. The C<%options> structure is optional and may contain options passed through to the user agent. The only useful options are C (which should have a hashref value) and C and C to @@ -216,7 +218,7 @@ such a hashref: data => {...}, errors => [...], }, - error => 'Something happened', # may be ommitted if no error occurred + error => 'Something happened', # omitted if no error occurred details => { # optional information which may aide troubleshooting }, }