001/* 002Below is the copyright agreement for the Ptolemy II system. 003 004Copyright (c) 2010-2011 The Regents of the University of California. 005All rights reserved. 006 007Permission is hereby granted, without written agreement and without 008license or royalty fees, to use, copy, modify, and distribute this 009software and its documentation for any purpose, provided that the above 010copyright notice and the following two paragraphs appear in all copies 011of this software. 012 013IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 014FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 015ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 016THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 017SUCH DAMAGE. 018 019THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 020INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 021MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 022PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 023CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 024ENHANCEMENTS, OR MODIFICATIONS. 025 026Ptolemy II includes the work of others, to see those copyrights, follow 027the copyright link on the splash page or see copyright.htm. 028 */ 029package org.json; 030 031/** 032 * The JSONException is thrown by the JSON.org classes when things are amiss. 033 * @author JSON.org 034@version $Id$ 035@since Ptolemy II 10.0 036 * @version 2008-09-18 037 */ 038public class JSONException extends Exception { 039 /** 040 * 041 */ 042 private static final long serialVersionUID = 0; 043 private Throwable cause; 044 045 /** 046 * Constructs a JSONException with an explanatory message. 047 * @param message Detail about the reason for the exception. 048 */ 049 public JSONException(String message) { 050 super(message); 051 } 052 053 public JSONException(Throwable t) { 054 super(t.getMessage()); 055 this.cause = t; 056 } 057 058 @Override 059 public Throwable getCause() { 060 return this.cause; 061 } 062}