crimson/errorator: helpers for tl::expected
`ErrorHelper` is supposed to facilitate transformation of `std::error_code`
(and similar) into an immediately failed errorated `future` with extra error
checking.
The main idea is to let something like:
```cpp
my_ertr_t::future<my_value_t> foo() {
// ...
// `maybe_decoded` here is an instance of `tl::expected` carrying `std::error_code`
// in its error part
if (!maybe_decoded) {
// `std::error_code` can convey errors `my_ertr_t` does not allow – in that case,
// it would be helpful to get at least a run-time assert.
return ErrorHelper<my_ertr_t>::from_error<my_value_t>(maybe_decoded.error());
}
// ...
}
```
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit
a7ffc18eb40b9145fca5f064c4b3d097bffeb8d0)