From bd11472c0eb5c23fd300136ebb73c4b6c72f454b Mon Sep 17 00:00:00 2001 From: gregor herrmann Date: Sun, 27 Aug 2017 22:57:06 +0200 Subject: [PATCH] Derive OrmException from std::runtime_error. --- src/orm/ormrecord.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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(){} }; -- 2.39.5