2017-05-29 13:00 GMT+02:00 Vicente J. Botet Escriba via Boost < boost@lists.boost.org>:
Le 29/05/2017 à 09:04, Gavin Lambert via Boost a écrit :
On 29/05/2017 18:12, Vicente J. Botet Escriba wrote:
What your checked_outcome<T>::error will return if the is a
exception_ptr?
Ah, finally someone brought this up. Good!
It returns an error_code with bad_outcome_category and bad_outcome_errc::exception_present.
Ugh. Why your design is never coherent. Why you don't name your functions after what they do? What if the exception_ptr contains an arbitrary exception? No way to obtain an error_code :( I believe your design is too much guided by your AFIO use case. Not all the applications use system errors.
I think you may have misinterpreted that. Niall's saying (if I haven't misinterpreted myself) that calling error() on an outcome that contains any arbitrary exception will give that one specific error code (which basically tells you that your code is probably wrong to have asked, but it's not a precondition violation).
Of what specific error code are you talking about? How do you get one from exception_ptr?
No, he has one dedicate code for the occasion: error_type((int) monad_errc::exception_present, monad_category()) See: https://github.com/ned14/boost.outcome/blob/56c6ea31e1857e0ee415780b9a5f25ce... Regards, &rzej;