
13 Jul
2017
13 Jul
'17
12:29 a.m.
On 13/07/2017 11:48, Emil Dotchevski wrote:
then you have no choice but to do an error domain conversion.
In case of Outcome, yes.
In case of Noexcept, no, it has been designed to be able to propagate the original error object.
That worries me a bit where code is using a generic type such as int for error codes but don't have the same meanings for the values. It would be very easy to accidentally let one slip through without conversion so that it ends up representing the wrong error. Granted, Outcome doesn't help much with that issue either, unless you wrap them in a std::error_code. (For Noexcept, the equivalent would be to always convert to a typed enum at the earliest opportunity and never allow a plain int to propagate.)