001/* Exception for graph invalid state exceptions 002 003 Copyright (c) 2008-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.graph; 029 030import ptolemy.kernel.util.InvalidStateException; 031 032////////////////////////////////////////////////////////////////////////// 033//// GraphInvalidStateException 034 035/** 036 Exception for graph invalid state action errors. This exception is 037 thrown when an object has a state that is not permitted. 038 039 This is a RuntimeException and thus need not be declared by a method. 040 041 @author Mingyung Ko 042 @version $Id$ 043 @since Ptolemy II 8.0 044 @Pt.ProposedRating Red (myko) 045 @Pt.AcceptedRating Red (ssb) 046 */ 047@SuppressWarnings("serial") 048public class GraphInvalidStateException extends InvalidStateException { 049 050 // This class extends IllegalActionException so that we have 051 // the dependency from graph to kernel.util in as few places 052 // as possible. However, we must extend InvaldiStateException 053 // because that is the exception that is caught in the UI, 054 // which indicates which actor has a problem. A better design 055 // would be to have base class exceptions that do not 056 // refer to NamedObj in a separate package and then have 057 // kernel.util exceptions extend those exceptions. 058 059 /** 060 * Construct an exception with a detail message. This exception 061 * is thrown when an object has a state that is not permitted. 062 * @param message Detailed description of the error. 063 */ 064 public GraphInvalidStateException(String message) { 065 super(message); 066 } 067 068 /** Construct an exception with a detail message that includes the 069 * name of the first argument, the cause and the third argument string. 070 * @param cause The cause of this exception. 071 * @param detail The message. 072 */ 073 public GraphInvalidStateException(Throwable cause, String detail) { 074 super(null, null, cause, detail); 075 } 076}