20#ifndef LIBREPCB_CORE_EXCEPTIONS_H
21#define LIBREPCB_CORE_EXCEPTIONS_H
109 const QString& msg = QString(
"Exception")) noexcept;
152 const char*
what() const noexcept override;
155 virtual
void raise()
const override {
throw *
this; }
192 const QString& msg = QString(
"Logic Error")) noexcept;
200 virtual
void raise()
const override {
throw *
this; }
229 const QString& msg = QString(
"Runtime Error")) noexcept;
242 virtual void raise()
const override {
throw *
this; }
270 const QString& msg = QString(
"Range Error")) noexcept;
281 template <typename Tval, typename Tmin, typename Tmax>
282 RangeError(const
char* file,
int line, const Tval& value, const Tmin& min,
283 const Tmax& max) noexcept
285 QString("Range error: %1 not in [%2..%3]")
296 virtual void raise()
const override {
throw *
this; }
329 const QString& invalidFileContent = QString(),
330 const QString& msg = QString(
"File Parse Error")) noexcept;
338 virtual
void raise()
const override {
throw *
this; }
382 const QString& msg = QString(
"User Canceled")) noexcept;
390 virtual
void raise()
const override {
throw *
this; }
The Exception class.
Definition: exceptions.h:84
QString mFile
the source filename where the exception was thrown
Definition: exceptions.h:161
Exception()=delete
The default constructor.
const QString & getFile() const
Get the source file where the exception was thrown.
Definition: exceptions.h:132
int mLine
the line number where the exception was thrown
Definition: exceptions.h:162
virtual void raise() const override
Definition: exceptions.h:155
QString mMsg
the error message (translated)
Definition: exceptions.h:160
QByteArray mMsgUtf8
the message as an UTF8 byte array
Definition: exceptions.h:165
const QString & getMsg() const
Get the error message (translated)
Definition: exceptions.h:125
int getLine() const
Get the line number where the exception was thrown.
Definition: exceptions.h:139
const char * what() const noexcept override
reimplemented from std::exception::what()
Definition: exceptions.cpp:49
virtual Exception * clone() const override
Definition: exceptions.h:156
The FileParseError class.
Definition: exceptions.h:312
virtual void raise() const override
Definition: exceptions.h:338
virtual FileParseError * clone() const override
Definition: exceptions.h:339
FileParseError()=delete
Default Constructor.
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The LogicError class.
Definition: exceptions.h:181
virtual LogicError * clone() const override
Definition: exceptions.h:201
virtual void raise() const override
Definition: exceptions.h:200
LogicError()=delete
Default Constructor.
The RangeError class.
Definition: exceptions.h:259
virtual void raise() const override
Definition: exceptions.h:296
virtual RangeError * clone() const override
Definition: exceptions.h:297
RangeError()=delete
Default Constructor.
The RuntimeError class.
Definition: exceptions.h:218
RuntimeError()=delete
Default Constructor.
virtual void raise() const override
Definition: exceptions.h:242
virtual RuntimeError * clone() const override
Definition: exceptions.h:243
The UserCanceled class.
Definition: exceptions.h:371
virtual void raise() const override
Definition: exceptions.h:390
virtual UserCanceled * clone() const override
Definition: exceptions.h:391
UserCanceled()=delete
Default Constructor.
Definition: occmodel.cpp:77