Skip to content

Commit f16682b

Browse files
authored
Merge pull request stleary#375 from johnjaylward/FixExceptionWrapping
fixes wrapped exceptions
2 parents d2a66a4 + 18952b5 commit f16682b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

JSONArray.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public JSONArray(JSONTokener x) throws JSONException {
111111
char nextChar = x.nextClean();
112112
if (nextChar == 0) {
113113
// array is unclosed. No ']' found, instead EOF
114-
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
114+
throw x.syntaxError("Expected a ',' or ']'");
115115
}
116116
if (nextChar != ']') {
117117
x.back();
@@ -126,12 +126,12 @@ public JSONArray(JSONTokener x) throws JSONException {
126126
switch (x.nextClean()) {
127127
case 0:
128128
// array is unclosed. No ']' found, instead EOF
129-
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
129+
throw x.syntaxError("Expected a ',' or ']'");
130130
case ',':
131131
nextChar = x.nextClean();
132132
if (nextChar == 0) {
133133
// array is unclosed. No ']' found, instead EOF
134-
throw new JSONException(x.syntaxError("Expected a ',' or ']'"));
134+
throw x.syntaxError("Expected a ',' or ']'");
135135
}
136136
if (nextChar == ']') {
137137
return;

0 commit comments

Comments
 (0)