Merge pull request #1499 from oxen-io/neuroscr-submitchall-fix

Replace unused textResponse with used noJson, updating logging
pull/1502/head
Ryan Tharp 4 years ago committed by GitHub
commit e5cea8a23e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -287,7 +287,7 @@ const serverRequest = async (endpoint, options = {}) => {
txtResponse = await result.text(); txtResponse = await result.text();
// cloudflare timeouts (504s) will be html... // cloudflare timeouts (504s) will be html...
response = options.textResponse ? txtResponse : JSON.parse(txtResponse); response = options.noJson ? txtResponse : JSON.parse(txtResponse);
// result.status will always be 200 // result.status will always be 200
// emulate the correct http code if available // emulate the correct http code if available
@ -303,7 +303,7 @@ const serverRequest = async (endpoint, options = {}) => {
e.message, e.message,
`json: ${txtResponse}`, `json: ${txtResponse}`,
'attempting connection to', 'attempting connection to',
url url.toString()
); );
} else { } else {
log.error( log.error(
@ -311,7 +311,7 @@ const serverRequest = async (endpoint, options = {}) => {
e.code, e.code,
e.message, e.message,
'attempting connection to', 'attempting connection to',
url url.toString()
); );
} }

Loading…
Cancel
Save