1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

Merge pull request #375 from johnjaylward/FixExceptionWrapping

fixes wrapped exceptions
This commit is contained in:
Sean Leary 2017-11-02 21:42:29 -05:00 committed by GitHub
commit f16682bf44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ public class JSONArray implements Iterable<Object> {
char nextChar = x.nextClean();
if (nextChar == 0) {
// array is unclosed. No ']' found, instead EOF
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
throw x.syntaxError("Expected a ',' or ']'");
}
if (nextChar != ']') {
x.back();
@ -126,12 +126,12 @@ public class JSONArray implements Iterable<Object> {
switch (x.nextClean()) {
case 0:
// array is unclosed. No ']' found, instead EOF
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
throw x.syntaxError("Expected a ',' or ']'");
case ',':
nextChar = x.nextClean();
if (nextChar == 0) {
// array is unclosed. No ']' found, instead EOF
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
throw x.syntaxError("Expected a ',' or ']'");
}
if (nextChar == ']') {
return;