From 12e081d5c51fb58929b6748f1b38abb01bf2025b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 25 Aug 2023 16:03:29 +0200 Subject: [PATCH] rethrow better MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog-backend/src/processing/TaskPipeline.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/catalog-backend/src/processing/TaskPipeline.ts b/plugins/catalog-backend/src/processing/TaskPipeline.ts index 06e5c5db53..44030be9e0 100644 --- a/plugins/catalog-backend/src/processing/TaskPipeline.ts +++ b/plugins/catalog-backend/src/processing/TaskPipeline.ts @@ -117,10 +117,13 @@ export function startTaskPipeline(options: Options) { } } - pipelineLoop().catch(_error => { + pipelineLoop().catch(error => { // This should be impossible, but if it did happen, it would signal a // programming error inside the loop (errors should definitely be caught - // inside of it). + // inside of it). Let's rethrow with more information, and let it be caught + // by the process' uncaught exception handler, which will log the occurrence + // at a high level. + throw new Error(`Unexpected error in processing pipeline loop`, error); }); return () => {