Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Dec 19, 2024
1 parent 869b773 commit a9eb938
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/agent/hooks/onInspectionInterceptorResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, "../..");
Expand Down Expand Up @@ -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())}`
)
);
}
}
Expand Down

0 comments on commit a9eb938

Please sign in to comment.