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
I was calling getFormSubmissions() and seeing debug output, but my process exited immediately without waiting for the promise. After much frustration I accessed the API URL outputted by the debug info through my browser, and found the following error:
{"responseCode":301,"location":"https:\/\/eu-api.jotform.com\/form\/REDACTED\/submissions","message":"Your account is in EU Safe mode. Please use \"eu-api.jotform.com\" endpoint to get your results."}
I was handling errors correctly, so I didn't understand why I was not getting an exception (through the "fail" handler). I checked the code and came across the following in the sendRequest function of your index.js file (line 41):
If the request comes back with a response.statusCode == 200, but there's a different response code in the JSON body, the deferred is neither resolved nor rejected. The code assumes that the HTTP status code will match the API response code, but to be sure you should check
you probably also should initialize your Error with body.message only when there's a body, and with a library error otherwise... if the HTTP response fails it's not guaranteed you'll have a JSON body.
The text was updated successfully, but these errors were encountered:
I was calling
getFormSubmissions()
and seeing debug output, but my process exited immediately without waiting for the promise. After much frustration I accessed the API URL outputted by the debug info through my browser, and found the following error:I was handling errors correctly, so I didn't understand why I was not getting an exception (through the "fail" handler). I checked the code and came across the following in the
sendRequest
function of yourindex.js
file (line 41):If the request comes back with a response.statusCode == 200, but there's a different response code in the JSON body, the deferred is neither resolved nor rejected. The code assumes that the HTTP status code will match the API response code, but to be sure you should check
you probably also should initialize your Error with
body.message
only when there's a body, and with a library error otherwise... if the HTTP response fails it's not guaranteed you'll have a JSON body.The text was updated successfully, but these errors were encountered: