Skip to content

Commit

Permalink
Update scoping in switch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alexs-mparticle committed Dec 9, 2024
1 parent 096ea0b commit c6d00d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/identityApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -161,6 +161,7 @@ export default function IdentityAPIClient(
if (errorResponse?.code) {
message += ' - ' + errorResponse.code;
}
}
}

verbose(message);
Expand Down Expand Up @@ -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) {
Expand All @@ -262,6 +263,7 @@ export default function IdentityAPIClient(
const errorMessage = errorResponse.Errors.map((error) => error.message).join(', ');
message += ' - ' + errorMessage;
}
}
}

verbose(message);
Expand Down

0 comments on commit c6d00d2

Please sign in to comment.