1 /* 2 SPDX-FileCopyrightText: 2012 Volker Krause <vkrause@kde.org> 3 4 SPDX-License-Identifier: LGPL-2.0-or-later 5 */ 6 7 #pragma once 8 9 #include "exception.h" 10 11 class QSqlQuery; 12 13 namespace Akonadi 14 { 15 namespace Server 16 { 17 /** Exception for reporting SQL errors. */ 18 class DbException : public Exception 19 { 20 public: 21 explicit DbException(const QSqlQuery &query, const char *what = nullptr); 22 const char *type() const throw() override; 23 }; 24 25 class DbDeadlockException : public DbException 26 { 27 public: 28 explicit DbDeadlockException(const QSqlQuery &query); 29 }; 30 31 } // namespace Server 32 } // namespace Akonadi 33 34