X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/ebe26af4f4448f1c3dd125c63da6cc080541a6b5..080dc7d603d45ba0662aa731418993ddd45b5fe8:/src/orm/ormrecord.h diff --git a/src/orm/ormrecord.h b/src/orm/ormrecord.h index 3ca3a25..32a4d5e 100644 --- a/src/orm/ormrecord.h +++ b/src/orm/ormrecord.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011-2015 Philipp Spitzer, gregor herrmann, Stefan Stahl + * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl * * This file is part of ConfClerk. * @@ -27,12 +27,13 @@ #include #include #include +#include -class OrmException +class OrmException: public std::runtime_error { public: - OrmException(const QString& text) : mText(text) {} - virtual ~OrmException(){} + OrmException(const QString& text) : std::runtime_error(text.toStdString()), mText(text) {} + virtual ~OrmException() throw() {} virtual const QString& text() const { return mText; } private: QString mText; @@ -41,15 +42,15 @@ private: class OrmNoObjectException : public OrmException { public: - OrmNoObjectException() : OrmException("No object exception"){} - ~OrmNoObjectException(){} + OrmNoObjectException() : OrmException("SQL query expects one record but found none."){} + ~OrmNoObjectException() throw() {} }; class OrmSqlException : public OrmException { public: OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {} - ~OrmSqlException(){} + ~OrmSqlException() throw() {} }; template