From a9eb93834344f1332a6988268ead4de6c323d9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Thu, 19 Dec 2024 17:06:20 +0100 Subject: [PATCH] Fix merge --- library/agent/hooks/onInspectionInterceptorResult.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/agent/hooks/onInspectionInterceptorResult.ts b/library/agent/hooks/onInspectionInterceptorResult.ts index 1e64fb2f..5f0fda0c 100644 --- a/library/agent/hooks/onInspectionInterceptorResult.ts +++ b/library/agent/hooks/onInspectionInterceptorResult.ts @@ -6,6 +6,7 @@ import { attackKindHumanName } from "../Attack"; import { getContext, updateContext } from "../Context"; import type { InterceptorResult } from "./InterceptorResult"; import type { WrapPackageInfo } from "./WrapPackageInfo"; +import { cleanError } from "../../helpers/cleanError"; // Used for cleaning up the stack trace const libraryRoot = resolve(__dirname, "../.."); @@ -49,8 +50,10 @@ export function onInspectionInterceptorResult( }); if (agent.shouldBlock()) { - throw new Error( - `Zen has blocked ${attackKindHumanName(result.kind)}: ${result.operation}(...) originating from ${result.source}${escapeHTML((result.pathsToPayload || []).join())}` + throw cleanError( + new Error( + `Zen has blocked ${attackKindHumanName(result.kind)}: ${result.operation}(...) originating from ${result.source}${escapeHTML((result.pathsToPayload || []).join())}` + ) ); } }