mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 16:39:22 +08:00
ObjectJsonReader.typeMismatch should return not throw.
This commit is contained in:
@@ -346,10 +346,10 @@ final class ObjectJsonReader extends JsonReader {
|
|||||||
|
|
||||||
private JsonDataException typeMismatch(Object value, Object expected) {
|
private JsonDataException typeMismatch(Object value, Object expected) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new JsonDataException(
|
return new JsonDataException(
|
||||||
"Expected " + expected + " but was null at path " + getPath());
|
"Expected " + expected + " but was null at path " + getPath());
|
||||||
} else {
|
} else {
|
||||||
throw new JsonDataException("Expected " + expected + " but was " + value + ", a "
|
return new JsonDataException("Expected " + expected + " but was " + value + ", a "
|
||||||
+ value.getClass().getName() + ", at path " + getPath());
|
+ value.getClass().getName() + ", at path " + getPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user