krakenjs / post-robot

Cross domain post-messaging on the client side using a simple listener/client pattern.
Apache License 2.0
741 stars 92 forks source link

Unwanted rewriting of stack & name properties from Error serializer #61

Closed dackmin closed 5 years ago

dackmin commented 6 years ago

Is there any particular reason .stack and .name Error properties are not serialized as-is ? Currently .stack is prefixed with .message and .name is simply replaced with the default Error one.

Also, I currently have to use your non-standard .code property to pass error data (typically an object — for an xhr error for example) between child/parents. Would it be possible to add a new .data or .whatever property to the error serializer ? This would be particularly useful when extending Error using ES6 classes.

bluepnume commented 6 years ago

So:

All in all -- good suggestions. Thanks for the issue!

bluepnume commented 5 years ago

This is fixed in the latest version.