rlalfo / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

Show the original HTTP request details in the error message #214

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://javadoc.google-http-java-client.googlecode.com/hg/1.14.1-beta/com/google/
api/client/http/HttpResponseException.html

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

Try running this snippet of code:

new NetHttpTransport().createRequestFactory().buildGetRequest(new 
GenericUrl("http://www.google.com/doesnotexist")).execute();

It will throw this exception stack trace:

Exception in thread "main" com.google.api.client.http.HttpResponseException: 
404 Not Found
<!DOCTYPE html>
...
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1170)

It would be helpful to specify also that we were accessing the URL 
http://www.google.com/doesnotexist with the HTTP GET method.  Perhaps we could 
even show the HTTP headers.

In this case it's obviously not helpful, but one can imagine in a complex 
application without logging enabled there may be cases where it may be 
difficult to debug what went wrong.

Original issue reported on code.google.com by yan...@google.com on 6 Apr 2013 at 12:00

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 10 Jun 2013 at 1:08

GoogleCodeExporter commented 9 years ago

Original comment by ngmic...@google.com on 19 Aug 2013 at 8:24

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 27 Sep 2013 at 11:57