Skip to content

[Identity] Decouple CredentialUnavailableError from AuthenticationRequiredError #14751

Closed

Description

While both errors CredentialUnavailableError from AuthenticationRequiredError can be used in the same scenario, the one of skipping ChainedTokenCredential, the way to assert for errors in JavaScript is through the error names, which we overwrite regardless of the inheritance (the child class gets to have its own name only, not the parent name). So, if it's only for the name, which is the current use case of both errors, the inheritance is unnecessary.

Also, add this on the ChainedTokenCredential, and add a test:

-       if (err.name === "CredentialUnavailableError") {
+       if (err.name === "CredentialUnavailableError" || err.name === "AuthenticationRequiredError") {

Also add a test.

From: #14690 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.blocking-releaseBlocks release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions