From e81f6f73536e2939864f7efdf21835abdf245294 Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Mon, 10 May 2021 18:29:14 +0400 Subject: [PATCH] fix(rest): reject a string instead of object (#918) * fix(rest): reject a string instead of object * reject an error for stack trace --- src/rest/process_queue.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rest/process_queue.ts b/src/rest/process_queue.ts index d7d3a76b6..38bab963b 100644 --- a/src/rest/process_queue.ts +++ b/src/rest/process_queue.ts @@ -119,10 +119,9 @@ export async function processQueue(id: string) { break; } - queuedRequest.request.reject?.({ - status: response.status, - body: JSON.stringify({ error }), - }); + queuedRequest.request.reject?.( + new Error(`[${response.status}] ${error}`), + ); // If Rate limited should not remove from queue if (response.status !== 429) queue.shift();