Closed jumoog closed 4 years ago
in my case the server returns not json if the server is overloaded
I'm not so sure that {} is really reasonable. Maybe null
would be more apt, but then still I think that most users would want to know if the parsing failed with a proper error rather than just by receiving null
.
if JSON.parse fails it should return {}
maybe you can do someting like