Each exception class must implement two helper functions to support throwing

and catching exceptions across thread boundaries.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-01-18 17:01:38 +02:00
parent 4f69c7766f
commit e5dc9d0667
7 changed files with 36 additions and 0 deletions

View File

@ -47,6 +47,11 @@ public:
VExceptionBadId(const VExceptionBadId &e); VExceptionBadId(const VExceptionBadId &e);
VExceptionBadId &operator=(const VExceptionBadId &e); VExceptionBadId &operator=(const VExceptionBadId &e);
virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionBadId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionBadId *clone() const override { return new VExceptionBadId(*this); }
virtual QString ErrorMessage() const override; virtual QString ErrorMessage() const override;
quint32 BadId() const; quint32 BadId() const;
QString BadKey() const; QString BadKey() const;

View File

@ -45,6 +45,12 @@ public:
VExceptionConversionError(const VExceptionConversionError &e); VExceptionConversionError(const VExceptionConversionError &e);
VExceptionConversionError &operator=(const VExceptionConversionError &e); VExceptionConversionError &operator=(const VExceptionConversionError &e);
virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionConversionError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionConversionError *clone() const override
{ return new VExceptionConversionError(*this); }
virtual QString ErrorMessage() const override; virtual QString ErrorMessage() const override;
QString String() const; QString String() const;
protected: protected:

View File

@ -48,6 +48,12 @@ public:
VExceptionEmptyParameter(const VExceptionEmptyParameter &e); VExceptionEmptyParameter(const VExceptionEmptyParameter &e);
VExceptionEmptyParameter &operator=(const VExceptionEmptyParameter &e); VExceptionEmptyParameter &operator=(const VExceptionEmptyParameter &e);
virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionEmptyParameter() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionEmptyParameter *clone() const override
{ return new VExceptionEmptyParameter(*this); }
virtual QString ErrorMessage() const override; virtual QString ErrorMessage() const override;
virtual QString DetailedInformation() const override; virtual QString DetailedInformation() const override;
QString Name() const; QString Name() const;

View File

@ -37,6 +37,11 @@ public:
VExceptionInvalidNotch(const VExceptionInvalidNotch &e); VExceptionInvalidNotch(const VExceptionInvalidNotch &e);
VExceptionInvalidNotch &operator=(const VExceptionInvalidNotch &e); VExceptionInvalidNotch &operator=(const VExceptionInvalidNotch &e);
virtual ~VExceptionInvalidNotch() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionInvalidNotch() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionInvalidNotch *clone() const override
{ return new VExceptionInvalidNotch(*this); }
}; };
#endif // VEXCEPTIONINVALIDNOTCH_H #endif // VEXCEPTIONINVALIDNOTCH_H

View File

@ -49,6 +49,11 @@ public:
VExceptionObjectError(const VExceptionObjectError &e); VExceptionObjectError(const VExceptionObjectError &e);
VExceptionObjectError &operator=(const VExceptionObjectError &e); VExceptionObjectError &operator=(const VExceptionObjectError &e);
virtual ~VExceptionObjectError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionObjectError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionObjectError *clone() const override { return new VExceptionObjectError(*this); }
virtual QString ErrorMessage() const override; virtual QString ErrorMessage() const override;
virtual QString DetailedInformation() const override; virtual QString DetailedInformation() const override;
QString TagText() const; QString TagText() const;

View File

@ -41,6 +41,10 @@ public:
explicit VExceptionUndo(const QString &what); explicit VExceptionUndo(const QString &what);
VExceptionUndo(const VExceptionUndo &e); VExceptionUndo(const VExceptionUndo &e);
virtual ~VExceptionUndo() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionUndo() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionUndo *clone() const override { return new VExceptionUndo(*this); }
}; };
#endif // VEXCEPTIONUNDO_H #endif // VEXCEPTIONUNDO_H

View File

@ -48,6 +48,11 @@ public:
VExceptionWrongId(const VExceptionWrongId &e); VExceptionWrongId(const VExceptionWrongId &e);
VExceptionWrongId &operator=(const VExceptionWrongId &e); VExceptionWrongId &operator=(const VExceptionWrongId &e);
virtual ~VExceptionWrongId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; virtual ~VExceptionWrongId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT;
Q_NORETURN virtual void raise() const override { throw *this; }
Q_REQUIRED_RESULT virtual VExceptionWrongId *clone() const override { return new VExceptionWrongId(*this); }
virtual QString ErrorMessage() const override; virtual QString ErrorMessage() const override;
virtual QString DetailedInformation() const override; virtual QString DetailedInformation() const override;
QString TagText() const; QString TagText() const;