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 <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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user