view Exception/SQLException.cpp @ 104:6bc013d5788b

Avoid unnecessary updates. Fix problems with wrong subset being selected for update with prefix. Fix some problems with to much verbosity in debug statements.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Sat, 15 Feb 2014 13:34:10 +0100
parents f507a7240bc9
children
line wrap: on
line source

#include "SQLException.hpp"

#include <QtSql/QSqlError>
#include <QtSql/QSqlQuery>

SQLException::SQLException(const QString& errorMsg) : Exception(errorMsg)
{
}

SQLException::SQLException(const QSqlQuery& errorQuery) :
  Exception(errorQuery.lastError().text() + ":" + errorQuery.lastQuery())
{
}

SQLException::SQLException(QSqlQuery& errorQuery, bool clear) :
  Exception(errorQuery.lastError().text() + ":" + errorQuery.lastQuery())
{
  if (clear)
    errorQuery.clear();
}

void SQLException::raise() const
{
  throw *this;
}