From 0759465bdf9b7dc1bc61883735b3fb61c488d3b5 Mon Sep 17 00:00:00 2001 From: Douglas Crockford Date: Tue, 19 Feb 2013 04:41:16 -0800 Subject: [PATCH] RuntimeException --- JSONException.java | 66 ++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/JSONException.java b/JSONException.java index 289b602..09250c5 100755 --- a/JSONException.java +++ b/JSONException.java @@ -1,28 +1,38 @@ -package org.json; - -/** - * The JSONException is thrown by the JSON.org classes when things are amiss. - * @author JSON.org - * @version 2010-12-24 - */ -public class JSONException extends Exception { - private static final long serialVersionUID = 0; - private Throwable cause; - - /** - * Constructs a JSONException with an explanatory message. - * @param message Detail about the reason for the exception. - */ - public JSONException(String message) { - super(message); - } - - public JSONException(Throwable cause) { - super(cause.getMessage()); - this.cause = cause; - } - - public Throwable getCause() { - return this.cause; - } -} +package org.json; + +/** + * The JSONException is thrown by the JSON.org classes when things are amiss. + * + * @author JSON.org + * @version 2013-02-10 + */ +public class JSONException extends RuntimeException { + private static final long serialVersionUID = 0; + private Throwable cause; + + /** + * Constructs a JSONException with an explanatory message. + * + * @param message + * Detail about the reason for the exception. + */ + public JSONException(String message) { + super(message); + } + + /** + * Constructs a new JSONException with the specified cause. + */ + public JSONException(Throwable cause) { + super(cause.getMessage()); + 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() { + return this.cause; + } +}