Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions