-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJExceptions.hpp
More file actions
77 lines (62 loc) · 2.03 KB
/
JExceptions.hpp
File metadata and controls
77 lines (62 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef JEXCEPTION_HPP
#define JEXCEPTION_HPP
#include <stdexcept>
#include <string>
namespace J {
using std::runtime_error;
using std::string;
class JException: public runtime_error {
public:
JException(string msg, string prefix = "JException"): runtime_error(prefix + ": " + msg) {};
};
class JIllegalDimensionsException: public JException {
public:
JIllegalDimensionsException(string msg = "Illegal dimensions given"):
JException(msg, "JIllegalDimensionsException") {}
};
class JIllegalRankException: public JException {
public:
JIllegalRankException(string msg = "Illegal rank given"): JException(msg, "JIllegalRankException") {}
};
class JIllegalTypeCastException: public JException {
public:
JIllegalTypeCastException(string msg = "Failed to cast type"):
JException(msg, "JIllegalTypeCastException") {}
};
class JIllegalValueTypeException: public JException {
public:
JIllegalValueTypeException(string msg = "Illegal value type given"):
JException(msg, "JIllegalValuetypeException") {}
};
class JNoUnitException: public JException {
public:
JNoUnitException(string msg = "No unit for verb"):
JException(msg, "JNoUnitException") {}
};
class JIllegalGrammarClassException: public JException {
public:
JIllegalGrammarClassException(string msg = "Illegal grammar class given"):
JException(msg, "JIllegalGrammarClassException") {}
};
class JIllegalSyntaxException: public JException {
public:
JIllegalSyntaxException(string msg = "Illegal syntax"):
JException(msg, "JIllegalSyntaxException") {}
};
class JIllegalImportException: public JException {
public:
JIllegalImportException(string msg = "Illegal import performed"):
JException(msg, "JIllegalImportException") {}
};
class JParserException: public JException {
public:
JParserException(string msg = "Failed to parse") :
JException(msg, "JParserException") {}
};
class JUnimplementedOperationException: public JException {
public:
JUnimplementedOperationException(string msg = "Unimplemented operation"):
JException(msg) {}
};
}
#endif