forked from qt-creator/qt-creator
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:
@@ -29,19 +29,21 @@
|
|||||||
|
|
||||||
#include <utils/smallstring.h>
|
#include <utils/smallstring.h>
|
||||||
|
|
||||||
|
#include <exception>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace Sqlite {
|
namespace Sqlite {
|
||||||
|
|
||||||
class SQLITE_EXPORT Exception
|
class SQLITE_EXPORT Exception : public std::exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Exception(const char *whatErrorHasHappen,
|
Exception(const char *whatErrorHasHappen,
|
||||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||||
: m_whatErrorHasHappen(whatErrorHasHappen),
|
: m_whatErrorHasHappen(whatErrorHasHappen)
|
||||||
m_sqliteErrorMessage(std::move(sqliteErrorMessage))
|
, m_sqliteErrorMessage(std::move(sqliteErrorMessage))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
const char *what() const noexcept override { return m_sqliteErrorMessage.data(); }
|
||||||
|
|
||||||
void printWarning() const;
|
void printWarning() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user