From 40fa6491fb46fd7a61caae0b2915e66ca6815665 Mon Sep 17 00:00:00 2001 From: KoshaevEugeny <103786108+akulistus@users.noreply.github.com> Date: Wed, 11 Mar 2026 21:34:49 +0300 Subject: [PATCH] feat(workers): catch-unhandled-exceptions (#532) * feat(workers): add decorator to catch unhandled exceptions and report them to Hawk with worker type context * fix lint * Revert "fix lint" This reverts commit 7a7c0a94b3cc95b1e97af1b33b9d899935631cf3. * Revert "feat(workers): add decorator to catch unhandled exceptions and report them to Hawk with worker type context" This reverts commit ebb1fd74a0ee627ba903fc763760ca0361739283. * refactor(runner): add active worker names to HawkCatcher context --- runner.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/runner.ts b/runner.ts index 443beea8..5dd05b1b 100644 --- a/runner.ts +++ b/runner.ts @@ -12,10 +12,6 @@ import * as dotenv from 'dotenv'; dotenv.config(); -if (process.env.HAWK_CATCHER_TOKEN) { - HawkCatcher.init(process.env.HAWK_CATCHER_TOKEN); -} - type WorkerConstructor = new () => Worker; const BEGINNING_OF_ARGS = 2; @@ -27,6 +23,18 @@ const BEGINNING_OF_ARGS = 2; */ const workerNames = process.argv.slice(BEGINNING_OF_ARGS); +/** + * Initialize HawkCatcher +*/ +if (process.env.HAWK_CATCHER_TOKEN) { + HawkCatcher.init({ + token: process.env.HAWK_CATCHER_TOKEN, + context: { + workerTypes: workerNames.join(","), + } + }); +} + /** * Workers dispatcher. * Load, run and finish workers.