From ab4757d942ff8103e4229f06eecf6e781afbe859 Mon Sep 17 00:00:00 2001 From: Victor Santos Date: Thu, 23 Oct 2025 16:37:40 -0300 Subject: [PATCH] refactor(northflank): replace custom error handling with standard Error for Northflank API calls --- .../secret-sync/northflank/northflank-sync-fns.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/backend/src/services/secret-sync/northflank/northflank-sync-fns.ts b/backend/src/services/secret-sync/northflank/northflank-sync-fns.ts index 396aa9ac8..42faf77fb 100644 --- a/backend/src/services/secret-sync/northflank/northflank-sync-fns.ts +++ b/backend/src/services/secret-sync/northflank/northflank-sync-fns.ts @@ -4,7 +4,6 @@ import { request } from "@app/lib/config/request"; import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns"; import { TSecretMap } from "@app/services/secret-sync/secret-sync-types"; -import { SecretSyncError } from "../secret-sync-errors"; import { TNorthflankSyncWithCredentials } from "./northflank-sync-types"; const NORTHFLANK_API_URL = "https://api.northflank.com"; @@ -79,10 +78,7 @@ const getNorthflankSecrets = async (secretSync: TNorthflankSyncWithCredentials): return variables; } catch (error: unknown) { - throw new SecretSyncError({ - error, - message: `Failed to fetch Northflank secrets. ${buildNorthflankAPIErrorMessage(error)}` - }); + throw new Error(`Failed to fetch Northflank secrets. ${buildNorthflankAPIErrorMessage(error)}`); } }; @@ -113,10 +109,7 @@ const updateNorthflankSecrets = async ( } ); } catch (error: unknown) { - throw new SecretSyncError({ - error, - message: `Failed to update Northflank secrets. ${buildNorthflankAPIErrorMessage(error)}` - }); + throw new Error(`Failed to update Northflank secrets. ${buildNorthflankAPIErrorMessage(error)}`); } };