enhancementhelp wanted
仓库指标
- 星标
- (599 个星标)
- PR 合并指标
- (30 天内没有已合并 PR)
描述
An issue I found when throwing deserialized errors is that the thrown error has no reference to this throw point.
I think the "correct" way to throw serialized errors would be something like:
throw new Error(serialized.message, {
cause: deserializeError(serialized),
});
Two drawbacks:
new Errordoesn't benefit from https://github.com/sindresorhus/serialize-error/pull/70- this isn't necessarily what people want or expect by default
So how about:
throw deserializeError(serialized, {preserveStack: true});