Creating a Schema for Translating Data to Tagged, Yieldable Errors
Hi. I want to create a Schema that translates some arbitrary data to a tagged, nominal, yieldable error. For example,
- I don't think I can use
- I don't think I can use
{foo: "bar"} should become something like new MyFooError({_tag: "MyFooError", foo: "bar"}).- I don't think I can use
S.TaggedError, because it expects the _tag to be on the encoded data. I want it to be attached while decoding.- I don't think I can use
S.Class, because it doesn't let me extend from YieldableError.