File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ public String nextString(char quote) throws JSONException {
281281 try {
282282 sb .append ((char )Integer .parseInt (this .next (4 ), 16 ));
283283 } catch (NumberFormatException e ) {
284- throw this .syntaxError ("Illegal escape." );
284+ throw this .syntaxError ("Illegal escape." , e );
285285 }
286286 break ;
287287 case '"' :
@@ -437,6 +437,16 @@ public JSONException syntaxError(String message) {
437437 return new JSONException (message + this .toString ());
438438 }
439439
440+ /**
441+ * Make a JSONException to signal a syntax error.
442+ *
443+ * @param message The error message.
444+ * @param causedBy The throwable that caused the error.
445+ * @return A JSONException object, suitable for throwing
446+ */
447+ public JSONException syntaxError (String message , Throwable causedBy ) {
448+ return new JSONException (message + this .toString (), causedBy );
449+ }
440450
441451 /**
442452 * Make a printable string of this JSONTokener.
You can’t perform that action at this time.
0 commit comments