diff --git a/httpResponseChecker.js b/httpResponseChecker.js index 14ed413..1e91a6d 100644 --- a/httpResponseChecker.js +++ b/httpResponseChecker.js @@ -1,18 +1,18 @@ try { msg = JSON.parse(msg) // we are going to reset msg to be its value in JSON here. - $c('isJSONresponse', true) + $co('isJSONresponse', true) } catch (e) { // we have an empty msg or some other non-JSON response - $c('isJSONresponse', false) + $co('isJSONresponse', false) } var responseStatusLine = $('responseStatusLine'); var responseCode = parseInt(responseStatusLine.split(' ')[1], 10); if ( responseCode == 200) { // we have an entirely successful message (note no check on isJSON, buyer beware) - $c('API_Post_OK',true) + $co('API_Post_OK',true) process_results(); } else { // we either have an entirely bad post (endpoint not answering OR we have a JSON error) - if ($c('isJSONresponse') == true) { // do not retry, just collect the JSON stuff + if ($co('isJSONresponse') == true) { // do not retry, just collect the JSON stuff responseStatus = SENT bad_call_error_handler(JSON.stringify(msg)) } else { // Let's retry a few times @@ -20,7 +20,7 @@ if ( responseCode == 200) { // we have an entirely successful message (note n responseStatus = QUEUED // } else { // exceeded the tries responseStatus = SENT - $c('API_Post_OK',false) + $co('API_Post_OK',false) bad_call_error_handler(msg) // we have tried this post a few times, responseStatus will already be ERROR, so just send the alert } }