forked from qt-creator/qt-creator
Sqlite: Cleanup exceptions
Change-Id: Id5ac7e6aba407eb5a3164bba57bff043e809beef Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -25,16 +25,12 @@
|
||||
|
||||
#include "sqliteexception.h"
|
||||
|
||||
#include <utils/smallstringio.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
namespace Sqlite {
|
||||
|
||||
SqliteException::SqliteException(const char *whatErrorHasHappen, const char *sqliteErrorMessage)
|
||||
: m_whatErrorHasHappen(whatErrorHasHappen),
|
||||
m_sqliteErrorMessage(sqliteErrorMessage)
|
||||
{
|
||||
}
|
||||
|
||||
void SqliteException::printWarning() const
|
||||
{
|
||||
if (!m_sqliteErrorMessage.isEmpty())
|
||||
|
@@ -27,20 +27,25 @@
|
||||
|
||||
#include "sqliteglobal.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <utils/smallstring.h>
|
||||
|
||||
namespace Sqlite {
|
||||
|
||||
class SQLITE_EXPORT SqliteException
|
||||
{
|
||||
public:
|
||||
SqliteException(const char *m_whatErrorHasHappen, const char *sqliteErrorMessage = 0);
|
||||
SqliteException(Utils::SmallString &&whatErrorHasHappen,
|
||||
Utils::SmallString &&sqliteErrorMessage = Utils::SmallString())
|
||||
: m_whatErrorHasHappen(std::move(whatErrorHasHappen)),
|
||||
m_sqliteErrorMessage(std::move(sqliteErrorMessage))
|
||||
{
|
||||
}
|
||||
|
||||
void printWarning() const;
|
||||
|
||||
private:
|
||||
const char *m_whatErrorHasHappen;
|
||||
QByteArray m_sqliteErrorMessage;
|
||||
Utils::SmallString m_whatErrorHasHappen;
|
||||
Utils::SmallString m_sqliteErrorMessage;
|
||||
};
|
||||
|
||||
} // namespace Sqlite
|
||||
|
@@ -27,9 +27,8 @@
|
||||
|
||||
namespace Sqlite {
|
||||
|
||||
SqlStatementBuilderException::SqlStatementBuilderException(const char *whatErrorHasHappen, const char *errorMessage)
|
||||
: SqliteException(whatErrorHasHappen, errorMessage)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace Sqlite
|
||||
|
@@ -32,7 +32,7 @@ namespace Sqlite {
|
||||
class SQLITE_EXPORT SqlStatementBuilderException : public SqliteException
|
||||
{
|
||||
public:
|
||||
SqlStatementBuilderException(const char *m_whatErrorHasHappen, const char *errorMessage = 0);
|
||||
using SqliteException::SqliteException;
|
||||
};
|
||||
|
||||
} // namespace Sqlite
|
||||
|
Reference in New Issue
Block a user