ts-results
ts-results copied to clipboard
Feature request: support error cause in `expect`
class Err {
// ...
expect(msg: string) {
throw new Error(msg, { cause: this.val })
}
}
I think I'm asking about a similar thing here: https://github.com/vultix/ts-results/issues/48
@Jack-Works do you think the pattern in your opening post is the best way to resolve this?
Error cause is a new JavaScript proposal to bring another Error in the current Error object.
Thanks for the explanation, I like it. I'll add this to https://github.com/lune-climate/ts-results-es