Serialize non-error cause - #204
Conversation
a968b55 to
3aba4c4
Compare
|
I also consider presence of |
cabae2b to
6e70d86
Compare
jsumners
left a comment
There was a problem hiding this comment.
I don't think we should promote handling of not errors.
|
Neither do I tbh. @Andreyco what does it currently happen? |
|
hello everyone, thanks for finding time to respond...
Basically, Promises rejected with non error as reason is the motivation for this PR. It's way too common among 3rd party packages. If you are 100% against and won't accept non error-like variant, let me reiterate on this PR, as there are some internal changes preventing me from writing custom wrapper around for error serializer (afaik Waiting for your response before acting. TY! |
Issues:
causeproperty set via constructor is not retained.Why is that happening:
{ cause?: unknown }causeproperty set via the constructor is non-enumerable. The serializers were primarily using a for...in loop to find extra properties, which skips non-enumerable ones.Why the change:
throw 42Promise.reject(42)err.cause = 42, but not viaError('ooops', { cause: 42 }))I really hope per commit "evolution" helps in review process.