]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/orm/ormrecord.h
Bump copyright years.
[toast/confclerk.git] / src / orm / ormrecord.h
index fe5d58dc17f1c94ecbba43af441effa343ed7118..32a4d5ec48a19839faefaa3e4173d850eafc680d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2014 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
  *
  * This file is part of ConfClerk.
  *
 #include <QStringList>
 #include <QDateTime>
 #include <QDebug>
 #include <QStringList>
 #include <QDateTime>
 #include <QDebug>
+#include <stdexcept>
 
 
-class OrmException
+class OrmException: public std::runtime_error
 {
 public:
 {
 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;
     virtual const QString& text() const { return mText; }
 private:
     QString mText;
@@ -41,15 +42,15 @@ private:
 class OrmNoObjectException : public OrmException
 {
 public:
 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 ) {}
 };
 
 class OrmSqlException : public OrmException
 {
 public:
     OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {}
-    ~OrmSqlException(){}
+    ~OrmSqlException() throw() {}
 };
 
 template <typename T>
 };
 
 template <typename T>