fix: use toJSON
for error serialization
#5526
Merged
Loading
toJSON
for error serialization
#5526