uber / rides-java-sdk

Uber Rides Java SDK (beta)
https://developer.uber.com/docs
MIT License
104 stars 57 forks source link

NPE for wrong clientSecret during TokenAccess #29

Open wasi1989 opened 7 years ago

wasi1989 commented 7 years ago

It was not showing correct message for wrong clientSecret rather throwing NPE. When i checked in code If response is not 200 then you are parsing it to TokenResponseException . You are creating instance of TokenResponseException by using response.getContent() and failing in JsonParser(below is code) because content is returning null . public JsonParser createJsonParser(InputStream in, Charset charset) throws IOException { Preconditions.checkNotNull(in); return new JacksonParser(this, this.factory.createJsonParser(in)); } SS attached.

More Details: http://stackoverflow.com/questions/41012392/unauthorized-error-in-uber-token-api response