From c6d00d2cc4db6a23d0f0ed9bf3a7dcdbb8ce5eb8 Mon Sep 17 00:00:00 2001 From: Alexander Sapountzis Date: Mon, 9 Dec 2024 10:11:00 -0500 Subject: [PATCH] Update scoping in switch cases --- src/identityApiClient.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/identityApiClient.ts b/src/identityApiClient.ts index f7ad3bc6..0915e810 100644 --- a/src/identityApiClient.ts +++ b/src/identityApiClient.ts @@ -148,7 +148,7 @@ export default function IdentityAPIClient( message = 'Successfully sent forwarding stats to mParticle Servers'; break; - default: + default: { // 400 has an error message, but 403 doesn't const errorResponse: IAliasErrorResponse = aliasResponseBody as unknown as IAliasErrorResponse; if (errorResponse?.message) { @@ -161,6 +161,7 @@ export default function IdentityAPIClient( if (errorResponse?.code) { message += ' - ' + errorResponse.code; } + } } verbose(message); @@ -253,7 +254,7 @@ export default function IdentityAPIClient( message += JSON.stringify(identityResponse.responseText); break; - default: + default: { // 400 has an error message, but 403 doesn't const errorResponse: IdentityApiErrorResponse = identityResponse.responseText as unknown as IdentityApiErrorResponse; if (errorResponse?.Errors) { @@ -262,6 +263,7 @@ export default function IdentityAPIClient( const errorMessage = errorResponse.Errors.map((error) => error.message).join(', '); message += ' - ' + errorMessage; } + } } verbose(message);