Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.61k stars 593 forks source link

Not helpfull error when JSONPointer can't find path #345

Closed ryber closed 4 years ago

ryber commented 4 years ago

Describe the bug When a JSONPointer fails to find a path you get an error of "May only query JSONObject or JSONArray", because that chunk of the path didn't exist.

To Reproduce new JSONPointer("/somewhere").queryFrom(new JSONObject("{\"foo\": \"bar\"}"))

Expected behavior a better error that details that the path was missing.

ryber commented 4 years ago

done