WEBELO
HTML Visualizer & DOM Library
Loading...
Searching...
No Matches
exceptions.cpp
1#ifndef EXCEPTIONS_DOM
2#define EXCEPTIONS_DOM
3
4#include <string>
5
6using namespace std;
7
8class InvalidStateError : public exception {
9 private:
10 string message;
11 public:
12 InvalidStateError(const char* msg): message(msg){};
13
14 const char* what() const noexcept {
15 return message.c_str();
16 }
17};
18
19class InvalidCharacterError : public exception {
20 private:
21 string message;
22 public:
23 InvalidCharacterError(const char* msg): message(msg){};
24
25 const char* what() const noexcept {
26 return message.c_str();
27 }
28};
29
30class NotSupportedError : public exception {
31 private:
32 string message;
33 public:
34 NotSupportedError(const char* msg): message(msg){};
35
36 const char* what() const noexcept {
37 return message.c_str();
38 }
39};
40
41class HeirarchyRequestError : public exception {
42 private:
43 string message;
44 public:
45 HeirarchyRequestError(const char* msg): message(msg){};
46
47 const char* what() const noexcept {
48 return message.c_str();
49 }
50};
51
52class NotFoundError : public exception {
53 private:
54 string message;
55 public:
56 NotFoundError(const char* msg): message(msg){};
57
58 const char* what() const noexcept {
59 return message.c_str();
60 }
61};
62
63
64class NamespaceError : public exception {
65 private:
66 string message;
67 public:
68 NamespaceError(const char* msg): message(msg){};
69
70 const char* what() const noexcept {
71 return message.c_str();
72 }
73};
74
75
76class AbortError: public exception {
77 private:
78 string message;
79 public:
80 AbortError(const char* msg): message(msg){};
81
82 const char* what() const noexcept {
83 return message.c_str();
84 }
85};
86
87
88class InUseAttributeError: public exception {
89 private:
90 string message;
91 public:
92 InUseAttributeError(const char* msg): message(msg){};
93
94 const char* what() const noexcept {
95 return message.c_str();
96 }
97};
98
99class SyntaxError: public exception {
100 private:
101 string message;
102 public:
103 SyntaxError(const char* msg): message(msg){};
104
105 const char* what() const noexcept {
106 return message.c_str();
107 }
108};
109
110class IndexSizeError: public exception {
111 private:
112 string message;
113 public:
114 IndexSizeError(const char* msg): message(msg){};
115
116 const char* what() const noexcept {
117 return message.c_str();
118 }
119};
120
121class InvalidNodeTypeError: public exception {
122 private:
123 string message;
124 public:
125 InvalidNodeTypeError(const char* msg): message(msg){};
126
127 const char* what() const noexcept {
128 return message.c_str();
129 }
130};
131
132
133class WrongDocumentError: public exception {
134 private:
135 string message;
136 public:
137 WrongDocumentError(const char* msg): message(msg){};
138
139 const char* what() const noexcept {
140 return message.c_str();
141 }
142};
143
144
145#endif