chore(api): add logs when sdk request fails by auth

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-12-07 20:31:20 +01:00
parent ca985d4fa6
commit 27ee623584

View File

@@ -18,9 +18,11 @@ export async function clientHook(
req.client = client;
} catch (error) {
if (error instanceof SdkAuthError) {
req.log.warn(error, 'Invalid SDK request');
return reply.status(401).send(error.message);
}
req.log.error(error, 'Invalid SDK request');
return reply.status(500).send('Internal server error');
}
}