Skip to content

Commit

Permalink
fix: don't fail on request's big payload
Browse files Browse the repository at this point in the history
Today we're serialising the request's payload to debug it. this fails when the payload is too be (see ticket https://snyk.zendesk.com/agent/tickets/6712).
This will skip and log another message in this scenario.
  • Loading branch information
admons committed Mar 2, 2021
1 parent 1228b55 commit 47e106e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/request/request.ts
Expand Up @@ -83,7 +83,11 @@ export = function makeRequest(
payload.timeout = config.timeout * 1000; // s -> ms
}

debug('request payload: ', JSON.stringify(payload));
try {
debug('request payload: ', JSON.stringify(payload));
} catch (e) {
debug('request payload is too big to log', e);
}

const method = (
payload.method || 'get'
Expand Down

0 comments on commit 47e106e

Please sign in to comment.