Changeset bd11472 for src/orm


Ignore:
Timestamp:
08/27/17 22:57:06 (5 years ago)
Author:
gregor herrmann <gregor@…>
Branches:
master, qt5
Children:
5def683
Parents:
860fc82
Message:

Derive OrmException? from std::runtime_error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/orm/ormrecord.h

    r860fc82 rbd11472  
    2828#include <QDateTime>
    2929#include <QDebug>
    30 
    31 class OrmException
    32 {
    33 public:
    34     OrmException(const QString& text) : mText(text) {}
     30#include <stdexcept>
     31
     32class OrmException : public std::runtime_error
     33{
     34public:
     35    OrmException(const QString& text) : std::runtime_error(text.toStdString()), mText(text) {}
    3536    virtual ~OrmException(){}
    3637    virtual const QString& text() const { return mText; }
     
    4243{
    4344public:
    44     OrmNoObjectException() : OrmException("No object exception"){}
     45    OrmNoObjectException() : OrmException("SQL query expects one record but found none."){}
    4546    ~OrmNoObjectException(){}
    4647};
Note: See TracChangeset for help on using the changeset viewer.