Skip to content

Conversation

@ctaggart
Copy link
Contributor

@ctaggart ctaggart commented May 27, 2021

This continues a refactor of error handling that started in #251. The biggest changes are:

  • Standardizing on a crate::Error
    • azure_core::errors::AzureError renamed to azure_core::Error
    • created an identity::Error
  • Every other public Error in the crate can convert into the crate::Error it so that ? is usable by consumers.
  • trait azure_core::TokenCredential remains the same
  • trait azure_identity::token_credentials::TokenCredential is the same as azure_core::TokenCredential, but returns a specific error from the azure_identity crate
  • created error types for each TokenCredential

@ctaggart ctaggart marked this pull request as draft May 27, 2021 02:01
@ctaggart ctaggart marked this pull request as ready for review May 27, 2021 23:29
@ctaggart ctaggart requested review from MindFlavor, heaths and rylev May 27, 2021 23:29
Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I obviously didn't look at every single file, but I believe I looked at all non-generated code.

.map(|s| -> Result<LoginResponse, Error> {
Ok(serde_json::from_str::<LoginResponse>(&s)?)
})?
// TODO The HTTP status code should be checked to deserialize an error response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create an issue for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctaggart ctaggart merged commit 23b09b3 into Azure:master May 28, 2021
@ctaggart ctaggart deleted the crate_Error branch May 28, 2021 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants