From 55c6b91b37017e63ffbc0854972eb5f6feaaa905 Mon Sep 17 00:00:00 2001 From: nameless Date: Fri, 10 Nov 2023 02:47:44 +0000 Subject: [PATCH] feat: remove url from error --- app/generationQueue.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/generationQueue.ts b/app/generationQueue.ts index 49700d0..43cc106 100644 --- a/app/generationQueue.ts +++ b/app/generationQueue.ts @@ -70,7 +70,8 @@ export async function processGenerationQueue() { return response; }) .catch((error) => { - workerInstance.update({ lastError: { message: error.message, time: Date.now() } }) + const cleanedErrorMessage = error.message.replace(/url \([^)]+\)/, ""); + workerInstance.update({ lastError: { message: cleanedErrorMessage, time: Date.now() } }) .catch(() => undefined); debug(`Worker ${workerInstance.value.key} is down: ${error}`); });