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

RuntimeException

This commit is contained in:
Douglas Crockford 2013-02-19 04:41:16 -08:00
parent 50c3afb216
commit 0759465bdf

View file

@ -2,26 +2,36 @@ package org.json;
/** /**
* The JSONException is thrown by the JSON.org classes when things are amiss. * The JSONException is thrown by the JSON.org classes when things are amiss.
*
* @author JSON.org * @author JSON.org
* @version 2010-12-24 * @version 2013-02-10
*/ */
public class JSONException extends Exception { public class JSONException extends RuntimeException {
private static final long serialVersionUID = 0; private static final long serialVersionUID = 0;
private Throwable cause; private Throwable cause;
/** /**
* Constructs a JSONException with an explanatory message. * Constructs a JSONException with an explanatory message.
* @param message Detail about the reason for the exception. *
* @param message
* Detail about the reason for the exception.
*/ */
public JSONException(String message) { public JSONException(String message) {
super(message); super(message);
} }
/**
* Constructs a new JSONException with the specified cause.
*/
public JSONException(Throwable cause) { public JSONException(Throwable cause) {
super(cause.getMessage()); super(cause.getMessage());
this.cause = cause; this.cause = cause;
} }
/**
* Returns the cause of this throwable or null if the cause is nonexistent or unknown.
* @returns the cause of this throwable or null if the cause is nonexistent or unknown.
*/
public Throwable getCause() { public Throwable getCause() {
return this.cause; return this.cause;
} }