google / gson

A Java serialization/deserialization library to convert Java Objects into JSON and back
Apache License 2.0
23.16k stars 4.27k forks source link

Improve location information for `JsonDeserializer` exceptions #2609

Closed Marcono1234 closed 5 months ago

Marcono1234 commented 5 months ago

Purpose

Resolves #1135

Description

When JsonDeserializer.deserialize throws an exception, wrap it and include the path of the JsonElement to make troubleshooting easier.

Risks of this approach:

:warning: So I am not completely sure if this is worth it. Feel free to reject this pull request (or suggest another solution).

Checklist