Skip to content

Commit

Permalink
Merge pull request #375 from johnjaylward/FixExceptionWrapping
Browse files Browse the repository at this point in the history
fixes wrapped exceptions
  • Loading branch information
stleary committed Nov 3, 2017
2 parents d2a66a4 + 18952b5 commit f16682b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions JSONArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public JSONArray(JSONTokener x) throws JSONException {
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();
Expand All @@ -126,12 +126,12 @@ public JSONArray(JSONTokener x) throws JSONException {
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;
Expand Down

0 comments on commit f16682b

Please sign in to comment.