From 43060ae503108b27f1bb35b3965e7722743b9d2e Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 11 Dec 2024 08:18:27 +1030 Subject: [PATCH] chore: Add docLinks to customer auth errors --- control-plane/src/modules/auth/customer-auth.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/control-plane/src/modules/auth/customer-auth.ts b/control-plane/src/modules/auth/customer-auth.ts index ebeeb357..4f08c3b6 100644 --- a/control-plane/src/modules/auth/customer-auth.ts +++ b/control-plane/src/modules/auth/customer-auth.ts @@ -89,14 +89,17 @@ export const verifyCustomerProvidedAuth = async ({ if (e instanceof JobPollTimeoutError) { throw new AuthenticationError( `Call to ${VERIFY_FUNCTION_ID} did not complete in time`, + "https://docs.inferable.ai/pages/auth#handlecustomerauth" ); } - if (e instanceof InvalidJobArgumentsError) { + if (e instanceof Error) { throw new AuthenticationError( - `Could not find ${VERIFY_FUNCTION_ID} registration`, + `Call to ${VERIFY_FUNCTION_ID} failed with error: ${e.message}`, + "https://docs.inferable.ai/pages/auth#handlecustomerauth" ); } + throw e; } };