samples-typescript icon indicating copy to clipboard operation
samples-typescript copied to clipboard

[Feature Request] Add Error ejson type

Open lorensr opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Error objects get turned into empty objects when run through data converter (JSON.stringify(new Error('test')) is {})

https://temporalio.slack.com/archives/C01DKSMU94L/p1651770690341829

Describe the solution you'd like

Add Error as a type: https://docs.meteor.com/api/ejson.html#EJSON-addType

lorensr avatar May 05 '22 18:05 lorensr

Better idea: switch to superjson, which supports Error and many other things, and is actively maintained:

https://github.com/blitz-js/superjson

lorensr avatar Feb 06 '23 04:02 lorensr