Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3497049
D5994.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5994.diff
View Options
diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -694,7 +694,12 @@
Logger::log(version_msg.str());
if (db_version == 0) {
- set_up_database(db);
+ auto db_created = set_up_database(db);
+ if (!db_created) {
+ sqlite3_close(db);
+ Logger::log("Database structure creation error.");
+ throw std::runtime_error("Database structure creation error");
+ }
Logger::log("Database structure created.");
sqlite3_close(db);
@@ -720,7 +725,8 @@
if (migrationResult == MigrationResult::FAILURE) {
migration_msg << "migration " << idx << " failed." << std::endl;
Logger::log(migration_msg.str());
- break;
+ sqlite3_close(db);
+ throw std::runtime_error(migration_msg.str());
}
if (migrationResult == MigrationResult::SUCCESS) {
migration_msg << "migration " << idx << " succeeded." << std::endl;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 5:54 PM (17 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682144
Default Alt Text
D5994.diff (1 KB)
Attached To
Mode
D5994: [native] throw exception when migration process will fail
Attached
Detach File
Event Timeline
Log In to Comment