Shaka Player Embedded
dom_exception.h
Go to the documentation of this file.
1 // Copyright 2016 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_JS_DOM_DOM_EXCEPTION_H_
16 #define SHAKA_EMBEDDED_JS_DOM_DOM_EXCEPTION_H_
17 
18 #include <string>
19 
20 #include "shaka/optional.h"
24 
25 namespace shaka {
26 namespace js {
27 namespace dom {
28 
29 class DOMException : public BackingObject {
30  DECLARE_TYPE_INFO(DOMException);
31 
32  public:
35 
38  return new DOMException(message, name);
39  }
40 
41  // NOTE: Should be labelled "name", but it conflicts with type info.
42  const std::string error_name;
43  const std::string message;
44  std::string stack;
45  // Legacy numeric code.
46  const int code;
47 
48  private:
50 };
51 
52 class DOMExceptionFactory : public BackingObjectFactory<DOMException> {
53  public:
55 };
56 
57 } // namespace dom
58 } // namespace js
59 } // namespace shaka
60 
61 #endif // SHAKA_EMBEDDED_JS_DOM_DOM_EXCEPTION_H_
ExceptionCode type
DOMException(ExceptionCode type)
static DOMException * Create(optional< std::string > message, optional< std::string > name)
Definition: dom_exception.h:36
const std::string error_name
Definition: dom_exception.h:42
const std::string message
Definition: dom_exception.h:43
std::string name() const