Open aidinrs opened 4 years ago
So you're calling requestSync with some data, but for some reason it fails and it sends you a non-JSON body?
@Fleker yes, I saw it in the logs a few times. I saw 403 unauthorized errors. Anyway, there certainly is a chance of it failling thus it should be wrapped around try-catch. for example google service not responding properly, being down or if you proxied the request and the proxy being down, .... this should not take my whole application down.
If response of the call to requestSync method is not in proper JSON then the response handler throws SyntaxError exception at JSON.parse, without rejecting the promise causing the whole node application to crash. it should be wrapped around a try-catch block and rejected properly.