now does correct error handling on insert name
But not very user friendly
This commit is contained in:
parent
5b37e32a81
commit
badd99b74b
@ -187,8 +187,8 @@ class sql_insert_name {
|
||||
public:
|
||||
sql_insert_name(ISqlite3* p) :
|
||||
csql_begin(p, R"|(BEGIN;)|"),
|
||||
csql_into_names(p, R"|(INSERT OR ROLLBACK INTO "Names" VALUES(?1);)|"),
|
||||
csql_namekey_into_keys(p, R"|(INSERT OR ROLLBACK INTO "Keys" VALUES(?1, last_insert_rowid(), 1);)|"),
|
||||
csql_into_names(p, R"|(INSERT OR FAIL INTO "Names" VALUES(?1);)|"),
|
||||
csql_namekey_into_keys(p, R"|(INSERT OR FAIL INTO "Keys" VALUES(?1, last_insert_rowid(), 1);)|"),
|
||||
csql_commit(p, R"|(COMMIT;)|"),
|
||||
csql_rollback(p, R"|(ROLLBACK;)|")
|
||||
{}
|
||||
@ -199,9 +199,9 @@ public:
|
||||
csql_into_names.do_one(psz);
|
||||
csql_namekey_into_keys.do_one(pt);
|
||||
}
|
||||
catch (const std::exception & e) {
|
||||
catch (const std::exception &) {
|
||||
csql_rollback.do_one();
|
||||
throw e;
|
||||
throw;
|
||||
}
|
||||
csql_commit.do_one();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user