From db89f3dd4d57320cbc12739c09dbdd8a26f24970 Mon Sep 17 00:00:00 2001 From: vanessa <32312712+vlbee@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:25:08 +0100 Subject: [PATCH] Fix missing Janus creds error in Dev mode --- src/server/lib/serverSideLogger.ts | 5 ++++- src/server/lib/trackMetric.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/lib/serverSideLogger.ts b/src/server/lib/serverSideLogger.ts index d63c6b2c4..5b65f46a1 100644 --- a/src/server/lib/serverSideLogger.ts +++ b/src/server/lib/serverSideLogger.ts @@ -59,7 +59,10 @@ class KinesisTransport extends Transport { }) .catch((error: unknown) => { if (error instanceof Error) { - if (error.name === 'ExpiredTokenException' && stage === 'DEV') { + if ( + error.name === 'CredentialsProviderError' && + stage === 'DEV' + ) { console.log(error.message); console.warn( 'AWS Credentials Expired. Have you added `Identity` Janus credentials?', diff --git a/src/server/lib/trackMetric.ts b/src/server/lib/trackMetric.ts index 548fbbc53..60b514e7f 100644 --- a/src/server/lib/trackMetric.ts +++ b/src/server/lib/trackMetric.ts @@ -59,7 +59,7 @@ export const trackMetric = ( ) .catch((error: unknown) => { if (error instanceof Error) { - if (error.name === 'ExpiredTokenException' && Stage === 'DEV') { + if (error.name === 'CredentialsProviderError' && Stage === 'DEV') { logger.warn(error.message); logger.warn( 'AWS Credentials Expired. Have you added `Identity` Janus credentials?',