2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef GNASH_GNASHEXCEPTION_H
20 #define GNASH_GNASHEXCEPTION_H
29 /// Top-level gnash exception
30 class DSOEXPORT GnashException
: public std::runtime_error
35 GnashException(const std::string
& s
)
42 std::runtime_error("Generic error")
45 virtual ~GnashException() throw() {}
48 /// An exception from MediaHandler subsystem
49 class DSOEXPORT MediaException
: public GnashException
54 MediaException(const std::string
& s
)
61 GnashException("Media error")
64 virtual ~MediaException() throw() {}
68 /// An exception from SoundHandler subsystem
69 class DSOEXPORT SoundException
: public GnashException
74 SoundException(const std::string
& s
)
81 GnashException("Audio error")
84 virtual ~SoundException() throw() {}
88 /// An SWF parsing exception
89 class DSOEXPORT ParserException
: public GnashException
94 ParserException(const std::string
& s
)
101 GnashException("Parser error")
104 virtual ~ParserException() throw() {}
108 /// An ActionScript error exception
109 class ActionException
: public GnashException
114 ActionException(const std::string
& s
)
121 GnashException("ActionScript error")
126 virtual ~ActionException() throw() {}
130 /// An ActionScript limit exception
132 /// When this exception is thrown, current execution should
133 /// be aborted, stacks and registers cleaning included.
135 class ActionLimitException
: public ActionException
140 ActionLimitException(const std::string
& s
)
145 ActionLimitException()
147 ActionException("ActionScript limit hit")
150 virtual ~ActionLimitException() throw() {}
154 /// An ActionScript type error
156 /// This exception can be thrown by as_value::to_primitive when an object
157 /// can't be converted to a primitive value or by native function when
158 /// they are called as method of an unexpected type
160 class ActionTypeError
: public ActionException
165 ActionTypeError(const std::string
& s
)
172 ActionException("ActionTypeError")
175 virtual ~ActionTypeError() throw() {}
179 /// An action parsing error, thrown on illegal
180 /// action buffer access.
181 class ActionParserException
: public ActionException
186 ActionParserException(const std::string
& s
)
191 ActionParserException()
193 ActionException("Action parser exception")
196 virtual ~ActionParserException() throw() {}
200 /// An unhandled exception in ActionScript, which should
201 /// interrupt code execution.
202 class ActionScriptException
: public ActionException
207 ActionScriptException(const std::string
& s
)
212 ActionScriptException()
214 ActionException("Unhandled ActionScript exception")
217 virtual ~ActionScriptException() throw() {}
224 #endif // def GNASH_GNASHEXCEPTION_H
231 // indent-tabs-mode: t