annotate lib/org.json_2.0/src/org/json/JSONException.java @ 0:db87c1b7eb6d

initial
author dwinter
date Wed, 03 Nov 2010 12:18:46 +0100
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
db87c1b7eb6d initial
dwinter
parents:
diff changeset
1 package org.json;
db87c1b7eb6d initial
dwinter
parents:
diff changeset
2
db87c1b7eb6d initial
dwinter
parents:
diff changeset
3 /**
db87c1b7eb6d initial
dwinter
parents:
diff changeset
4 * The JSONException is thrown by the JSON.org classes then things are amiss.
db87c1b7eb6d initial
dwinter
parents:
diff changeset
5 * @author JSON.org
db87c1b7eb6d initial
dwinter
parents:
diff changeset
6 * @version 2008-09-18
db87c1b7eb6d initial
dwinter
parents:
diff changeset
7 */
db87c1b7eb6d initial
dwinter
parents:
diff changeset
8 public class JSONException extends Exception {
db87c1b7eb6d initial
dwinter
parents:
diff changeset
9 private Throwable cause;
db87c1b7eb6d initial
dwinter
parents:
diff changeset
10
db87c1b7eb6d initial
dwinter
parents:
diff changeset
11 /**
db87c1b7eb6d initial
dwinter
parents:
diff changeset
12 * Constructs a JSONException with an explanatory message.
db87c1b7eb6d initial
dwinter
parents:
diff changeset
13 * @param message Detail about the reason for the exception.
db87c1b7eb6d initial
dwinter
parents:
diff changeset
14 */
db87c1b7eb6d initial
dwinter
parents:
diff changeset
15 public JSONException(String message) {
db87c1b7eb6d initial
dwinter
parents:
diff changeset
16 super(message);
db87c1b7eb6d initial
dwinter
parents:
diff changeset
17 }
db87c1b7eb6d initial
dwinter
parents:
diff changeset
18
db87c1b7eb6d initial
dwinter
parents:
diff changeset
19 public JSONException(Throwable t) {
db87c1b7eb6d initial
dwinter
parents:
diff changeset
20 super(t.getMessage());
db87c1b7eb6d initial
dwinter
parents:
diff changeset
21 this.cause = t;
db87c1b7eb6d initial
dwinter
parents:
diff changeset
22 }
db87c1b7eb6d initial
dwinter
parents:
diff changeset
23
db87c1b7eb6d initial
dwinter
parents:
diff changeset
24 public Throwable getCause() {
db87c1b7eb6d initial
dwinter
parents:
diff changeset
25 return this.cause;
db87c1b7eb6d initial
dwinter
parents:
diff changeset
26 }
db87c1b7eb6d initial
dwinter
parents:
diff changeset
27 }