From acb48140fd5eb0e900a5b0d533dc3321521df213 Mon Sep 17 00:00:00 2001 From: Dave Jeffery Date: Sun, 17 Nov 2024 22:37:06 +0000 Subject: [PATCH] fix: client-side `signFile` function should give better error message that includes the reason for failed signing --- src/client/index.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/client/index.ts b/src/client/index.ts index 93349fc..44515b3 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -65,9 +65,7 @@ export async function signFile(filePath: string): Promise { return response.data.signedFile; } catch (error) { if (error instanceof AxiosError) { - throw new Error( - `Failed to sign file: ${filePath} (${error.response?.status}, ${error.response?.statusText})`, - ); + error.message = `Failed to sign file: ${error.response?.data} (path: ${filePath})`; } throw error; }