Catch exceptions in SQLite3 callback

This commit is contained in:
Jude Melton-Houghton 2022-08-16 11:28:22 -04:00 committed by Loïc Blot
parent b89608c624
commit 006d974c58
1 changed files with 6 additions and 2 deletions

View File

@ -857,8 +857,12 @@ void ModMetadataDatabaseSQLite3::listMods(std::vector<std::string> *res)
char *errmsg;
int status = sqlite3_exec(m_database,
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
[](void *res_vp, int n_col, char **cols, char **col_names) -> int {
((decltype(res)) res_vp)->emplace_back(cols[0]);
[](void *res_vp, int n_col, char **cols, char **col_names) noexcept -> int {
try {
((decltype(res)) res_vp)->emplace_back(cols[0]);
} catch (...) {
return 1;
}
return 0;
}, (void *) res, &errmsg);
if (status != SQLITE_OK) {