Sqlite: Derive Sqlite::Exception from std::exception

Change-Id: I11a1162e5b450f71b8c2c4068ace6ef08825d7bb
Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2020-05-14 16:41:18 +02:00
committed by Tim Jenssen
parent 33a833d187
commit ebbb88b11a

View File

@@ -29,19 +29,21 @@
#include <utils/smallstring.h>
#include <exception>
#include <iostream>
namespace Sqlite {
class SQLITE_EXPORT Exception
class SQLITE_EXPORT Exception : public std::exception
{
public:
Exception(const char *whatErrorHasHappen,
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
: m_whatErrorHasHappen(whatErrorHasHappen),
m_sqliteErrorMessage(std::move(sqliteErrorMessage))
{
}
: m_whatErrorHasHappen(whatErrorHasHappen)
, m_sqliteErrorMessage(std::move(sqliteErrorMessage))
{}
const char *what() const noexcept override { return m_sqliteErrorMessage.data(); }
void printWarning() const;