mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Catch exceptions in SQLite3 callback
This commit is contained in:
parent
b89608c624
commit
006d974c58
1 changed files with 6 additions and 2 deletions
|
@ -857,8 +857,12 @@ void ModMetadataDatabaseSQLite3::listMods(std::vector<std::string> *res)
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
int status = sqlite3_exec(m_database,
|
int status = sqlite3_exec(m_database,
|
||||||
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
|
"SELECT `modname` FROM `entries` GROUP BY `modname`;",
|
||||||
[](void *res_vp, int n_col, char **cols, char **col_names) -> int {
|
[](void *res_vp, int n_col, char **cols, char **col_names) noexcept -> int {
|
||||||
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
try {
|
||||||
|
((decltype(res)) res_vp)->emplace_back(cols[0]);
|
||||||
|
} catch (...) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}, (void *) res, &errmsg);
|
}, (void *) res, &errmsg);
|
||||||
if (status != SQLITE_OK) {
|
if (status != SQLITE_OK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue