20 #ifndef LIBREPCB_CORE_EXCEPTIONS_H 21 #define LIBREPCB_CORE_EXCEPTIONS_H 109 const QString& msg = QString(
"Exception")) noexcept;
150 const char*
what()
const noexcept
override;
153 virtual void raise()
const override {
throw *
this; }
190 const QString& msg = QString(
"Logic Error")) noexcept;
198 virtual void raise()
const override {
throw *
this; }
227 const QString& msg = QString(
"Runtime Error")) noexcept;
240 virtual void raise()
const override {
throw *
this; }
268 const QString& msg = QString(
"Range Error")) noexcept;
279 template <
typename Tval,
typename Tmin,
typename Tmax>
280 RangeError(
const char* file,
int line,
const Tval& value,
const Tmin& min,
281 const Tmax& max) noexcept
283 QString(
"Range error: %1 not in [%2..%3]")
294 virtual void raise()
const override {
throw *
this; }
330 int fileLine = -1,
int fileColumn = -1,
331 const QString& invalidFileContent = QString(),
332 const QString& msg = QString(
"File Parse Error")) noexcept;
340 virtual void raise()
const override {
throw *
this; }
384 const QString& msg = QString(
"User Canceled")) noexcept;
392 virtual void raise()
const override {
throw *
this; }
virtual RangeError * clone() const override
Definition: exceptions.h:295
The LogicError class.
Definition: exceptions.h:179
RangeError(const char *file, int line, const Tval &value, const Tmin &min, const Tmax &max) noexcept
Definition: exceptions.h:280
virtual UserCanceled * clone() const override
Definition: exceptions.h:393
Exception()=delete
The default constructor.
int getLine() const
Get the line number where the exception was thrown.
Definition: exceptions.h:137
virtual LogicError * clone() const override
Definition: exceptions.h:199
const QString & getMsg() const
Get the error message (translated)
Definition: exceptions.h:123
Definition: occmodel.cpp:76
The Exception class.
Definition: exceptions.h:84
int mLine
the line number where the exception was thrown
Definition: exceptions.h:160
virtual Exception * clone() const override
Definition: exceptions.h:154
const char * what() const noexcept override
reimplemented from std::exception::what()
Definition: exceptions.cpp:49
QString mMsg
the error message (translated)
Definition: exceptions.h:158
The UserCanceled class.
Definition: exceptions.h:373
The RangeError class.
Definition: exceptions.h:257
The RuntimeError class.
Definition: exceptions.h:216
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:127
QByteArray mMsgUtf8
the message as an UTF8 byte array
Definition: exceptions.h:163
The FileParseError class.
Definition: exceptions.h:310
const QString & getFile() const
Get the source file where the exception was thrown.
Definition: exceptions.h:130
virtual RuntimeError * clone() const override
Definition: exceptions.h:241
virtual FileParseError * clone() const override
Definition: exceptions.h:341
virtual ~Exception() noexcept
The destructor.
Definition: exceptions.h:114
virtual ~RuntimeError() noexcept
Destructor.
Definition: exceptions.h:237
QString mFile
the source filename where the exception was thrown
Definition: exceptions.h:159