FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
JSExceptions.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Dec 18, 2010
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2009 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef JSExceptions_h__
17 #define JSExceptions_h__
18 #include <string>
19 #include <stdexcept>
20 #include <exception>
21 
22 namespace FB {
28  struct script_error : std::exception
29  {
30  script_error(const std::string& error)
31  : m_error(error)
32  { }
33  virtual ~script_error() throw() { }
34  virtual const char* what() const throw() {
35  return m_error.c_str();
36  }
37  std::string m_error;
38  };
39 
48  {
50  : script_error("Invalid Arguments")
51  { }
52  ~invalid_arguments() throw() { }
53 
54  invalid_arguments(const std::string& error)
55  : script_error(error)
56  { }
57  };
58 
70  {
72  : script_error("This object is no longer valid")
73  { }
74  ~object_invalidated() throw() { }
75  };
76 
84  {
85  invalid_member(const std::string& memberName)
86  : script_error("The specified member does not exist: " + memberName)
87  { }
88  ~invalid_member() throw() { }
89  };
90 }
91 
92 #endif // JSExceptions_h__
93 
Thrown by a JSAPI object when the argument(s) provided to a SetProperty or Invoke call are found to b...
Definition: JSExceptions.h:47
Thrown by a JSAPI object when a call is made on it after the object has been invalidated.
Definition: JSExceptions.h:69
Exception type; when thrown in a JSAPI method, a javascript exception will be thrown.
Definition: JSExceptions.h:28
Thrown when an Invoke, SetProperty, or GetProperty call is made for a member that is invalid (does no...
Definition: JSExceptions.h:83