Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add onError interface to Expected type (#1104)
Summary: So that we can do some thing in the middle or chaining, for example log the error. While using `Expected`, we found that It's nice to have the chaining operations, but one downside is there is no place to log each possible error here and there. So I added this `onError` interface, expecting usage like: Expected<D, Error> maybeD = someFunc() .then([](A a){return B(a);}) .onError([](Error e) { LOG_DEBUG("error happened while executing function A->B");}) .then([](B b){return C(b);}) .then([](C c){return D(c);}); Pull Request resolved: #1104 Reviewed By: dmm-fb Differential Revision: D15120090 Pulled By: yfeldblum fbshipit-source-id: 07bc30c96ede25ef415ff921592f1d8676489b17
- Loading branch information