From ad044b2afb62faac52d2fcea98f005601f4fa860 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 08:52:36 +0000 Subject: [PATCH] fix(internal): return in castToError instead of throwing --- src/internal/errors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/errors.ts b/src/internal/errors.ts index 653a6ec..82c7b14 100644 --- a/src/internal/errors.ts +++ b/src/internal/errors.ts @@ -22,7 +22,7 @@ export const castToError = (err: any): Error => { // @ts-ignore - not all envs have native support for cause yet if (err.cause && !error.cause) error.cause = err.cause; if (err.name) error.name = err.name; - throw error; + return error; } } catch {} try {