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?',