From d5797025fc3324f5dde1725dbd09edb0c777d410 Mon Sep 17 00:00:00 2001 From: Arc Studio Agent Date: Wed, 7 Oct 2026 19:38:53 +0000 Subject: [PATCH] fix(jwt): include curve name in unsupported algorithm error message Error constructor's second parameter expects ErrorOptions ({ cause }), not a plain string. Passing keypair.curve as a string was silently ignored, making the thrown error only say "Unsupported algorithm" with no indication of which curve triggered it. Replace with a template literal so the message is self-describing: "Unsupported algorithm: secp384r1" Consistent with the existing pattern in curveToJwtAlgorithm(), which already uses this form. --- packages/jwt/src/signer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jwt/src/signer.ts b/packages/jwt/src/signer.ts index bf617920..834aed1c 100644 --- a/packages/jwt/src/signer.ts +++ b/packages/jwt/src/signer.ts @@ -22,6 +22,6 @@ export function createJwtSigner(keypair: Keypair): JwtSigner { case "Ed25519": return EdDSASigner(keypair.privateKey) default: - throw new Error("Unsupported algorithm", keypair.curve) + throw new Error(`Unsupported algorithm: ${keypair.curve}`) } }