Catch more exceptions in lfs

This commit is contained in:
Thomas Goyne 2015-02-06 09:54:37 -08:00
parent 8cd970eb53
commit c013342caa

View file

@ -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>