From: gregor herrmann Date: Sun, 27 Aug 2017 20:57:06 +0000 (+0200) Subject: Derive OrmException from std::runtime_error. X-Git-Tag: 0.6.3~16^2~7 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/bd11472c0eb5c23fd300136ebb73c4b6c72f454b?hp=860fc824a625750c365248921af97c90d431e0b4 Derive OrmException from std::runtime_error. --- diff --git a/src/orm/ormrecord.h b/src/orm/ormrecord.h index 0dec7aa..30f569a 100644 --- a/src/orm/ormrecord.h +++ b/src/orm/ormrecord.h @@ -27,11 +27,12 @@ #include #include #include +#include -class OrmException +class OrmException : public std::runtime_error { public: - OrmException(const QString& text) : mText(text) {} + OrmException(const QString& text) : std::runtime_error(text.toStdString()), mText(text) {} virtual ~OrmException(){} virtual const QString& text() const { return mText; } private: @@ -41,7 +42,7 @@ private: class OrmNoObjectException : public OrmException { public: - OrmNoObjectException() : OrmException("No object exception"){} + OrmNoObjectException() : OrmException("SQL query expects one record but found none."){} ~OrmNoObjectException(){} };