aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2018-06-25 20:43:31 -0400
committerDeterminant <[email protected]>2018-06-25 20:43:31 -0400
commitb8c9b793d44426d01d62df11bc9185d26d0d0e40 (patch)
tree9370a3b31464ca63463d9c4bd122f4cef1da468a
parent304f38ec4e602c81b45b35e5e9734124bcf6fdcf (diff)
catch polymorphic exception by reference
-rw-r--r--promise.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/promise.hpp b/promise.hpp
index 9abd149..6f52583 100644
--- a/promise.hpp
+++ b/promise.hpp
@@ -486,7 +486,7 @@ namespace promise {
return [f](pm_any_t v) mutable {
try {
f(any_cast<typename func_t::arg_type>(v));
- } catch (bad_any_cast e) { PROMISE_ERR_MISMATCH_TYPE; }
+ } catch (bad_any_cast &e) { PROMISE_ERR_MISMATCH_TYPE; }
};
}
@@ -524,7 +524,7 @@ namespace promise {
try {
return typename func_t::ret_type(
f(any_cast<typename func_t::arg_type>(v)));
- } catch (bad_any_cast e) { PROMISE_ERR_MISMATCH_TYPE; }
+ } catch (bad_any_cast &e) { PROMISE_ERR_MISMATCH_TYPE; }
};
}