10 TfException(
const QString &message,
const char *fileName =
"",
int lineNumber = 0) noexcept :
12 file(fileName), line(lineNumber)
14 whatmsg = message.toLocal8Bit();
18 whatmsg +=
":" + QByteArray::number(lineNumber) +
"]";
23 msg(e.msg), file(e.file), line(e.line), whatmsg(e.whatmsg) { }
30 virtual void raise()
const {
throw *
this; }
32 virtual QString
className()
const {
return QStringLiteral(
"TfException"); }
33 virtual const char *
what() const noexcept
override {
return whatmsg.constData(); }
45 RuntimeException(
const QString &message,
const char *fileName =
"",
int lineNumber = 0) :
48 void raise()
const override {
throw *
this; }
50 QString
className()
const override {
return QStringLiteral(
"RuntimeException"); }
59 void raise()
const override {
throw *
this; }
61 QString
className()
const override {
return QStringLiteral(
"SecurityException"); }
67 SqlException(
const QString &message,
const char *fileName =
"",
int lineNumber = 0) :
70 void raise()
const override {
throw *
this; }
72 QString
className()
const override {
return QStringLiteral(
"SqlException"); }
78 KvsException(
const QString &message,
const char *fileName =
"",
int lineNumber = 0) :
81 void raise()
const override {
throw *
this; }
83 QString
className()
const override {
return QStringLiteral(
"KvsException"); }
90 TfException(QStringLiteral(
"HTTP status code: %1").arg(statusCode), fileName, lineNumber),
95 void raise()
const override {
throw *
this; }
97 QString
className()
const override {
return QStringLiteral(
"ClientErrorException"); }
109 void raise()
const override {
throw *
this; }
111 QString
className()
const override {
return QStringLiteral(
"StandardException"); }
The ClientErrorException class represents an exception that can be thrown when communication error wi...
Definition tfexception.h:87
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:96
QString className() const override
Returns exception class name.
Definition tfexception.h:97
void raise() const override
Raises the exception.
Definition tfexception.h:95
int statusCode() const
Returns the status code.
Definition tfexception.h:93
ClientErrorException(int statusCode, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:89
The KvsException class represents an exception that can be thrown when KVS database error occurs.
Definition tfexception.h:76
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:82
void raise() const override
Raises the exception.
Definition tfexception.h:81
KvsException(const QString &message, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:78
QString className() const override
Returns exception class name.
Definition tfexception.h:83
The RuntimeException class represents an exception that can be thrown when runtime error occurs.
Definition tfexception.h:43
void raise() const override
Raises the exception.
Definition tfexception.h:48
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:49
QString className() const override
Returns exception class name.
Definition tfexception.h:50
RuntimeException(const QString &message, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:45
The SecurityException class represents an exception that can be thrown when a security issue is detec...
Definition tfexception.h:54
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:60
void raise() const override
Raises the exception.
Definition tfexception.h:59
SecurityException(const QString &message, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:56
QString className() const override
Returns exception class name.
Definition tfexception.h:61
The SqlException class represents an exception that can be thrown when SQL database error occurs.
Definition tfexception.h:65
void raise() const override
Raises the exception.
Definition tfexception.h:70
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:71
SqlException(const QString &message, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:67
QString className() const override
Returns exception class name.
Definition tfexception.h:72
The StandardException class represents an exception that can be thrown when standard error occurs in ...
Definition tfexception.h:104
StandardException(const QString &message, const char *fileName="", int lineNumber=0)
Copy constructor.
Definition tfexception.h:106
std::exception * clone() const override
Creates and returns a deep copy of the current data.
Definition tfexception.h:110
QString className() const override
Returns exception class name.
Definition tfexception.h:111
void raise() const override
Raises the exception.
Definition tfexception.h:109
The TfException class is a base class for all TreeFrog exception classes.
Definition tfexception.h:8
virtual const char * what() const noexcept override
Definition tfexception.h:33
virtual std::exception * clone() const
Creates and returns a deep copy of the current data.
Definition tfexception.h:31
virtual void raise() const
Raises the exception.
Definition tfexception.h:30
int lineNumber() const
Return the line number.
Definition tfexception.h:28
QString message() const
Returns the message.
Definition tfexception.h:26
TfException(const QString &message, const char *fileName="", int lineNumber=0) noexcept
Constructor.
Definition tfexception.h:10
QByteArray whatmsg
Definition tfexception.h:39
TfException(const TfException &e) noexcept
Copy constructor.
Definition tfexception.h:21
QString msg
Definition tfexception.h:36
virtual QString className() const
Returns exception class name.
Definition tfexception.h:32
QString fileName() const
Returns the file name.
Definition tfexception.h:27
virtual ~TfException()
Destructor.
Definition tfexception.h:24
QString file
Definition tfexception.h:37
#define T_CORE_EXPORT
Definition tdeclexport.h:28