-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExceptions.cpp
More file actions
128 lines (104 loc) · 3.03 KB
/
Exceptions.cpp
File metadata and controls
128 lines (104 loc) · 3.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include "Exceptions.h"
Exception::Exception(QString message, QString file, int line, ExceptionType type)
: message_(message)
, file_(file)
, line_(line)
, type_(type)
{
}
QString Exception::message() const
{
return message_;
}
QString Exception::file() const
{
return file_;
}
int Exception::line() const
{
return line_;
}
ExceptionType Exception::type() const
{
return type_;
}
ArgumentException::ArgumentException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
FileAccessException::FileAccessException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
FileParseException::FileParseException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
ToolFailedException::ToolFailedException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
CommandLineParsingException::CommandLineParsingException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
ProgrammingException::ProgrammingException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
DatabaseException::DatabaseException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
TypeConversionException::TypeConversionException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
StatisticsException::StatisticsException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
AbortByUserException::AbortByUserException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
NotImplementedException::NotImplementedException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
AccessDeniedException::AccessDeniedException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
InformationMissingException::InformationMissingException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
NetworkException::NetworkException(QString message, QString file, int line, ExceptionType type)
: Exception(message, file, line, type)
{
}
HttpException::HttpException(QString message, QString file, int line, ExceptionType type, int status_code, QMap<QByteArray, QByteArray> headers, QByteArray body)
: Exception(message, file, line, type)
, status_code_(status_code)
, headers_(headers)
, body_(body)
, message_(message + ", server replied: " + body)
{
}
int HttpException::status_code() const
{
return status_code_;
}
QMap<QByteArray, QByteArray> HttpException::headers()
{
return headers_;
}
QByteArray HttpException::body() const
{
return body_;
}
QString HttpException::message() const
{
return message_;
}