JsonAdapter.fromJson
functions are documented as throwing IOException
but actually throw JsonDataException
#1885
Labels
JsonAdapter.fromJson
function are annotated with@Throws(IOException::class)
indicating that is the exception that they will throw when there is an error when deserializing a json string, however what is actually thrown is a JsonDataException which is aRuntimeException
meaning that if you try to catch the documentIOException
, your error handling code will be skipped.For example, consider the following code
JsonDataException
should extendIOException
, orJsonAdapter.fromJson
should be updated to indicate that they throwJsonDataException
The text was updated successfully, but these errors were encountered: