data: Still allow project refresh if database file can't be loaded
This commit is contained in:
@@ -964,8 +964,6 @@ void SqliteIndexStorage::setupTables()
|
||||
LOG_ERROR(std::to_string(e.errorCode()) + ": " + e.errorMessage());
|
||||
|
||||
throw(std::exception());
|
||||
|
||||
// todo: cancel project creation and destroy created files, display message
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,17 @@ void Project::load()
|
||||
canLoad = true;
|
||||
}
|
||||
|
||||
m_storage->setup();
|
||||
try
|
||||
{
|
||||
m_storage->setup();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Exception during storage loading.");
|
||||
|
||||
canLoad = false;
|
||||
m_state = PROJECT_STATE_DB_CORRUPTED;
|
||||
}
|
||||
|
||||
m_sourceGroups = SourceGroupFactory::getInstance()->createSourceGroups(m_settings->getAllSourceGroupSettings());
|
||||
|
||||
@@ -197,6 +207,12 @@ void Project::refresh(RefreshMode refreshMode, DialogView* dialogView)
|
||||
"the project fully reindexed. Do you want to update the project file and reindex the project?";
|
||||
needsFullRefresh = true;
|
||||
|
||||
case PROJECT_STATE_DB_CORRUPTED:
|
||||
question =
|
||||
"There was a problem loading the index of this project. The project needs to get fully reindexed. "
|
||||
"Do you want to reindex the project?";
|
||||
needsFullRefresh = true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ private:
|
||||
PROJECT_STATE_OUTDATED,
|
||||
PROJECT_STATE_OUTVERSIONED,
|
||||
PROJECT_STATE_SETTINGS_UPDATED,
|
||||
PROJECT_STATE_NEEDS_MIGRATION
|
||||
PROJECT_STATE_NEEDS_MIGRATION,
|
||||
PROJECT_STATE_DB_CORRUPTED
|
||||
};
|
||||
|
||||
Project(const Project&);
|
||||
|
||||
Reference in New Issue
Block a user