1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Demote error message storage from ProjectFileIO into DBConnection

This commit is contained in:
Paul Licameli
2020-09-02 14:59:03 -04:00
parent c9dec8f5a9
commit eb7e67623e
4 changed files with 74 additions and 40 deletions

View File

@@ -55,6 +55,28 @@ bool DBConnection::ShouldBypass()
return mBypass;
}
void DBConnection::SetError(
const TranslatableString &msg, const TranslatableString &libraryError)
{
mLastError = msg;
mLibraryError = libraryError;
}
void DBConnection::SetDBError(
const TranslatableString &msg, const TranslatableString &libraryError)
{
mLastError = msg;
wxLogDebug(wxT("SQLite error: %s"), mLastError.Debug());
printf(" Lib error: %s", mLastError.Debug().mb_str().data());
mLibraryError = libraryError.empty()
? Verbatim(sqlite3_errmsg(DB())) : libraryError;
wxLogDebug(wxT(" Lib error: %s"), mLibraryError.Debug());
printf(" Lib error: %s", mLibraryError.Debug().mb_str().data());
wxASSERT(false);
}
bool DBConnection::Open(const char *fileName)
{
wxASSERT(mDB == nullptr);