samchon / tgrid

TypeScript RPC (Remote Procedure Call) for WebSocket and Worker protocols
https://tgrid.com/
MIT License
141 stars 19 forks source link

Adapt serialize-error for JSON.stringify(Error) #14

Closed samchon closed 4 years ago

samchon commented 5 years ago

To send exact error instance being thrown, I'll adapt serialize-error.

If a thrown error instance has toJSON() method, then utilize it. Elsewhere, then the serialize-error would be used.

samchon commented 4 years ago

Adjusted