Small cleanup of exception conversion.
This commit is contained in:
parent
b2005299e4
commit
d9feb90593
|
@ -17,6 +17,7 @@
|
||||||
package com.google.gson;
|
package com.google.gson;
|
||||||
|
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
|
import com.google.gson.stream.JsonSyntaxException;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
|
||||||
import java.io.EOFException;
|
import java.io.EOFException;
|
||||||
|
@ -68,10 +69,11 @@ final class Streams {
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
} catch (EOFException e) {
|
||||||
|
return JsonNull.createJsonNull();
|
||||||
|
} catch (JsonSyntaxException e) {
|
||||||
|
throw new JsonParseException(e);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (e instanceof EOFException) {
|
|
||||||
return JsonNull.createJsonNull();
|
|
||||||
}
|
|
||||||
throw new JsonIOException(e);
|
throw new JsonIOException(e);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new JsonParseException(e);
|
throw new JsonParseException(e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user