TritonDataCenter / java-manta

Java Manta Client SDK
Mozilla Public License 2.0
16 stars 26 forks source link

some exception context classes appear to be missing toString #304

Open cburroughs opened 7 years ago

cburroughs commented 7 years ago

Specifically com.joyent.manta.org.apache.http.impl.execchain.ConnectionHolder@1ee8b444 and com.joyent.manta.org.apache.http.params.BasicHttpParams@7880feac could probably be more useful.

ERROR [pool-1-thread-48] 2017-08-05 01:34:35,976 Checker:145 - Error when checking: /foo
com.joyent.manta.exception.MantaClientHttpResponseException: HTTP request failed to: /foo Exception Context:
        [1:mantaSdkVersion=3.1.3]
        [2:statusLine=HTTP/1.1 400 Bad Request]
        [3:serverCode=InvalidHeader]
        [4:server_message=Invalid Signature Authorization header: clock skew of 382.763s was greater than 300s]
        [5:requestId=59673b74-797d-11e7-9a51-d3ae69f027a5]
        [6:request=HttpGet[version=<null>,uri=https://foo,config=<null>,aborted=false,cancellableRef=com.joyent.manta.org.apache.http.impl.execchain.ConnectionHolder@1ee8b444,headergroup=[],params=com.joyent.manta.org.apache.http.params.BasicHttpParams@7880feac]]
        [7:requestMethod=GET]
        [8:requestURL=https://foo]
        [9:requestHeaders=]
        [10:loadBalancerAddress=10.3.0.215]
        [11:response=HttpResponseProxy[original=HTTP/1.1 400 Bad Request [Content-Type: application/json, Content-Length: 121, Content-MD5: Ct2Q5iuz2vB3JDQ9xHYn9Q==, Date: Sat, 05 Aug 2017 01:34:35 GMT, Server: Manta, x-request-id: 59673b74-797d-11e7-9a51-d3ae69f027a5, x-response-time: 1, x-server-name: 4ed02f30-f3a5-4bda-933a-6a4509b0999f, Connection: keep-alive] ResponseEntityProxy{[Content-Type: application/json,Content-Length: 121,Chunked: false]},connHolder=com.joyent.manta.org.apache.http.impl.execchain.ConnectionHolder@1ee8b444]]
        [12:responseHeaders=Content-Type: application/json, Content-Length: 121, Content-MD5: Ct2Q5iuz2vB3JDQ9xHYn9Q==, Date: Sat, 05 Aug 2017 01:34:35 GMT, Server: Manta, x-request-id: 59673b74-797d-11e7-9a51-d3ae69f027a5, x-response-time: 1, x-server-name: 4ed02f30-f3a5-4bda-933a-6a4509b0999f, Connection: keep-alive]
        [13:responseStatusCode=400]
        [14:responseStatusReason=Bad Request]
dekobon commented 7 years ago

You will probably have to make a custom method that pulls apart the properties and uses a ToStringBuilder to extract the properties of the ConnectionHolder and BasicHttpParams classes.