Akonadi

dbexception.cpp
1 /*
2  SPDX-FileCopyrightText: 2012 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "dbexception.h"
8 
9 #include <QSqlError>
10 #include <QSqlQuery>
11 
12 using namespace Akonadi::Server;
13 
14 DbException::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 
21 const char *DbException::type() const throw()
22 {
23  return "Database Exception";
24 }
25 
26 DbDeadlockException::DbDeadlockException(const QSqlQuery &query)
27  : DbException(query, "Database deadlock, unsuccessful after multiple retries")
28 {
29 }
KSERVICE_EXPORT KService::List query(FilterFunc filterFunc)
Base class for exception used internally by the Akonadi server.
Exception for reporting SQL errors.
Definition: dbexception.h:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.