Hot take, but I have had success with using a polymorphic variant for the error type, it allows you to accumulate a wide range of possible errors as your promise value winds its way up the stack.
We use this for example, to project all the possible errors from graphql and apollo, and then many of the places where a resolver returned None along the way.
↧
Promise of result--why or why not?
↧