You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Occasionally, the Web Helper will throw a "503 Service Temporarily Unavailable". In that case, the response body from the Web Helper is:
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body bgcolor="white">
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
The library then attempts to parse this as JSON, fails, and throws the resulting SyntaxError: Unexpected token < in JSON at position 0. Unfortunately, the call does not get the entire body, so the client never knows that this was due to a 503 on the Web Helper.
These Web Helper errors tend to be transient, and usually go away on the next call.
This request is to more gracefully handle non-success HTTP results from the Web Helper. My solution would be to create my own error class that extends Error to indicate there was some kind of error with the Web Helper, and return the status code and content with the Error.
The text was updated successfully, but these errors were encountered:
Occasionally, the Web Helper will throw a "503 Service Temporarily Unavailable". In that case, the response body from the Web Helper is:
The library then attempts to parse this as JSON, fails, and throws the resulting SyntaxError:
Unexpected token < in JSON at position 0
. Unfortunately, the call does not get the entire body, so the client never knows that this was due to a 503 on the Web Helper.These Web Helper errors tend to be transient, and usually go away on the next call.
This request is to more gracefully handle non-success HTTP results from the Web Helper. My solution would be to create my own error class that extends Error to indicate there was some kind of error with the Web Helper, and return the status code and content with the Error.
The text was updated successfully, but these errors were encountered: