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; } };