001/* Some object or set of objects has a state that in theory is not permitted. 002 003 Copyright (c) 1997-2014 The Regents of the University of California. 004 All rights reserved. 005 Permission is hereby granted, without written agreement and without 006 license or royalty fees, to use, copy, modify, and distribute this 007 software and its documentation for any purpose, provided that the above 008 copyright notice and the following two paragraphs appear in all copies 009 of this software. 010 011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 015 SUCH DAMAGE. 016 017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 022 ENHANCEMENTS, OR MODIFICATIONS. 023 024 PT_COPYRIGHT_VERSION_2 025 COPYRIGHTENDKEY 026 027 */ 028package ptolemy.kernel.util; 029 030////////////////////////////////////////////////////////////////////////// 031//// InternalErrorException 032 033/** 034 This exception should be thrown if an unexpected error is encountered 035 other than one for which InvalidStateException would be appropriate. 036 Our design should make it impossible for this exception to ever occur, 037 so occurrence is a bug. This exception is a RuntimeException 038 so that it does not have to be declared. 039 040 @author Edward A. Lee, Christopher Hylands 041 @version $Id$ 042 @since Ptolemy II 0.2 043 @Pt.ProposedRating Green (cxh) 044 @Pt.AcceptedRating Green (cxh) 045 */ 046@SuppressWarnings("serial") 047public class InternalErrorException extends KernelRuntimeException { 048 /** Construct an exception with a detail message. 049 * @param detail The message. 050 */ 051 public InternalErrorException(String detail) { 052 super(detail); 053 } 054 055 /** Construct an exception with only a cause. 056 * If the cause argument is non-null, then the detail 057 * message of this argument will include the detail message of 058 * the cause argument. The stack trace of the cause argument is 059 * used when we print the stack trace of this exception. 060 * 061 * <p>This constructor is commonly used when we want to 062 * catch an exception and rethrow it as a RuntimeException 063 * so that the method where the exception is thrown 064 * need not declare that this method throws the initial exception. 065 * @param cause The cause of this exception. 066 */ 067 public InternalErrorException(Throwable cause) { 068 super(null, null, cause, null); 069 } 070 071 /** Construct an exception with a detail message that includes 072 * the names of the first argument plus the third argument 073 * string. If the cause argument is non-null, then the detail 074 * message of this argument will include the detail message of 075 * the cause argument. The stack trace of the cause argument is 076 * used when we print the stack trace of this exception. If one 077 * or more of the parameters are null, then the detail message is 078 * adjusted accordingly. 079 * 080 * @param object The object associated with this exception. 081 * @param cause The cause of this exception. 082 * @param detail The message. 083 */ 084 public InternalErrorException(Nameable object, Throwable cause, 085 String detail) { 086 super(object, null, cause, detail); 087 } 088 089 /** Construct an exception with a detail message that includes the 090 * names of the first argument, the name of the second argument 091 * and the value of the third argument. If the cause argument is 092 * non-null, then the detail message of this argument will 093 * include the detail message of the cause argument. The stack 094 * trace of the cause argument is used when we print the stack 095 * trace of this exception. If one or more of the parameters are 096 * null, then the detail message is adjusted accordingly. 097 * 098 * @param object The first object associated with this exception. 099 * @param object2 The second object associated with this exception. 100 * @param cause The cause of this exception. 101 * @param detail The message. 102 */ 103 public InternalErrorException(Nameable object, Nameable object2, 104 Throwable cause, String detail) { 105 super(object, object2, cause, detail); 106 } 107}