Verbose exception messages from gson? Verbose exception messages from gson? json json

Verbose exception messages from gson?


With Gson 2.3, you get a much nicer exception. It tells you the JSONPath to the failure, for example:

com.google.gson.JsonSyntaxException: Expected a boolean but was NUMBER at line 1 column 4728 path $.history[0].change_status.deletions    at com.google.gson.stream.JsonReader.nextBoolean()  at com.google.gson.TypeAdapters$3.read()  at com.google.gson.TypeAdapters$3.read()  at com.google.gson.ReflectiveTypeAdapter$1.read()  at com.google.gson.ReflectiveTypeAdapter$Adapter.read()  at com.google.gson.ReflectiveTypeAdapter$Adapter.read()  at com.google.gson.ReflectiveTypeAdapter$1.read()  at com.google.gson.ReflectiveTypeAdapter$Adapter.read()  ...