All JsonElement::getAsJsonXXX methods now include the JSON string on thrown exception's message
This commit is contained in:
parent
4a57ba6afd
commit
9d8d7a43e1
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user