All JsonElement::getAsJsonXXX methods now include the JSON string on thrown exception's message

This commit is contained in:
BloodShura 2017-02-07 22:04:22 -02:00
parent 4a57ba6afd
commit 9d8d7a43e1

View File

@ -103,7 +103,7 @@ public abstract class JsonElement {
if (isJsonArray()) { if (isJsonArray()) {
return (JsonArray) this; 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()) { if (isJsonPrimitive()) {
return (JsonPrimitive) this; 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()) { if (isJsonNull()) {
return (JsonNull) this; return (JsonNull) this;
} }
throw new IllegalStateException("This is not a JSON Null."); throw new IllegalStateException("Not a JSON Null: " + this);
} }
/** /**