Abydars / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

JsonSyntaxException is used to wrap IOExceptions in fromJson instead of using JsonIOException #548

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call fromJson(JsonReader reader, Type typeOfT) while provoking an IOException

What is the expected output? What do you see instead?
The thrown exception will be a JsonSyntaxException instead of a JsonIOException.

What version of the product are you using? On what operating system?
com.google.code:gson:gson:2.2.2

Please provide any additional information below.
The JsonSyntaxException is clearly the wrong wrapper for an IOException, 
because it makes it really awkward to differentiate network exceptions from 
syntax exceptions. Network exceptions can be recovered from by retrying, while 
syntax exceptions indicate a programming error on the client or server side.

Original issue reported on code.google.com by s.groeb...@googlemail.com on 13 Dec 2013 at 11:05