Merge pull request #1012 from BloodShura/master

All JsonElement::getAsJsonXXX methods now include the JSON string on thrown exception's message
This commit is contained in:
Jake Wharton 2017-02-07 19:17:28 -05:00 committed by GitHub
commit 7719e73a10

View File

@ -103,7 +103,7 @@ public abstract class JsonElement {
if (isJsonArray()) {
return (JsonArray) this;
}
throw new IllegalStateException("This is not a JSON Array.");
throw new IllegalStateException("Not a JSON Array: " + this);
}
/**
@ -119,7 +119,7 @@ public abstract class JsonElement {
if (isJsonPrimitive()) {
return (JsonPrimitive) this;
}
throw new IllegalStateException("This is not a JSON Primitive.");
throw new IllegalStateException("Not a JSON Primitive: " + this);
}
/**
@ -136,7 +136,7 @@ public abstract class JsonElement {
if (isJsonNull()) {
return (JsonNull) this;
}
throw new IllegalStateException("This is not a JSON Null.");
throw new IllegalStateException("Not a JSON Null: " + this);
}
/**