Akonadi

dbexception.cpp
1/*
2 SPDX-FileCopyrightText: 2012 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "dbexception.h"
8
9#include <QSqlError>
10#include <QSqlQuery>
11
12using namespace Akonadi::Server;
13
14DbException::DbException(const QSqlQuery &query, const char *what)
15 : Exception(what)
16{
17 mWhat += "\nSql error: " + query.lastError().text().toUtf8();
18 mWhat += "\nQuery: " + query.lastQuery().toUtf8();
19}
20
21const char *DbException::type() const throw()
22{
23 return "Database Exception";
24}
25
26DbDeadlockException::DbDeadlockException(const QSqlQuery &query)
27 : DbException(query, "Database deadlock, unsuccessful after multiple retries")
28{
29}
Exception for reporting SQL errors.
Definition dbexception.h:19
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:54:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.