Throwing JsonIOException on write failures

This commit is contained in:
Inderjeet Singh 2010-10-18 23:58:09 +00:00
parent 18a9205a04
commit 91bee2a688

View File

@ -366,7 +366,7 @@ public final class Gson {
try { try {
Streams.write(jsonElement, serializeNulls, writer); Streams.write(jsonElement, serializeNulls, writer);
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new JsonIOException(e);
} finally { } finally {
writer.setLenient(oldLenient); writer.setLenient(oldLenient);
writer.setHtmlSafe(oldHtmlSafe); writer.setHtmlSafe(oldHtmlSafe);