util/Error: use std::exception_ptr instead of std::exception

Necessary to preserve type information.  The try/catch sequence didn't
work previously.

Same fix as in commit 1c904000
This commit is contained in:
Max Kellermann
2016-02-26 16:32:24 +01:00
parent c85ba73371
commit d9e8ce22cb
4 changed files with 12 additions and 14 deletions

View File

@@ -81,7 +81,7 @@ try {
std::move(reader), info.GetSize(),
mutex, cond);
} catch (const std::exception &e) {
error.Set(e);
error.Set(std::current_exception());
return nullptr;
}
@@ -102,7 +102,7 @@ try {
offset = new_offset;
return true;
} catch (const std::exception &e) {
error.Set(e);
error.Set(std::current_exception());
return false;
}
@@ -113,7 +113,7 @@ try {
offset += nbytes;
return nbytes;
} catch (const std::exception &e) {
error.Set(e);
error.Set(std::current_exception());
return 0;
}