Catch more exceptions in lfs
This commit is contained in:
parent
8cd970eb53
commit
c013342caa
1 changed files with 5 additions and 3 deletions
|
@ -34,14 +34,16 @@ auto wrap(char **err, Func f) -> decltype(f()) {
|
||||||
try {
|
try {
|
||||||
return f();
|
return f();
|
||||||
}
|
}
|
||||||
catch (bfs::filesystem_error const& e) {
|
catch (std::exception const& e) {
|
||||||
*err = strdup(e.what());
|
*err = strdup(e.what());
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
catch (agi::Exception const& e) {
|
catch (agi::Exception const& e) {
|
||||||
*err = strndup(e.GetMessage());
|
*err = strndup(e.GetMessage());
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
catch (...) {
|
||||||
|
*err = strdup("Unknown error");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Ret>
|
template<typename Ret>
|
||||||
|
|
Loading…
Reference in a new issue