effector-devtools icon indicating copy to clipboard operation
effector-devtools copied to clipboard

Wrap JSON.stringify in try-catch

Open yumauri opened this issue 2 years ago • 1 comments

Wrap JSON.stringify in try-catch to avoid any stringify exception, like with circular object

yumauri avatar Feb 20 '23 14:02 yumauri

There are bunch of checks inside JSON.stringify, I conclude you are trying to avoid try-catch, maybe because of performance concerns, but I think you cannot foresee and check all possible objects, which could cause an error, so try-catch is vital here.

yumauri avatar Feb 20 '23 14:02 yumauri