From 47e106e79018b567b9d984a11385631b95ae6a88 Mon Sep 17 00:00:00 2001 From: Admon Sasson Date: Tue, 2 Mar 2021 12:51:50 +0200 Subject: [PATCH] fix: don't fail on request's big payload 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. --- src/lib/request/request.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/request/request.ts b/src/lib/request/request.ts index 4847a1cd31..0b51c14e1a 100644 --- a/src/lib/request/request.ts +++ b/src/lib/request/request.ts @@ -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'