Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new error mapping for http error code 403 and 404 #1457

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

Veena11
Copy link
Contributor

@Veena11 Veena11 commented Dec 18, 2024

Proposed changes

When token request fails with http error code 403 and 404 , we currently return MSIDErrorServerUnHandledResponse. This PR will add a new error MSIDErrorUnexpectedHttpResponse in case of http error code 403 or 404 and add this as an underlying error in the MSIDErrorServerUnHandledResponse error returned.

Type of change

  • [x ] Feature work
  • Bug fix
  • Documentation
  • Engineering change
  • Test
  • Logging/Telemetry

Risk

  • High – Errors could cause MAJOR regression of many scenarios. (Example: new large features or high level infrastructure changes)
  • Medium – Errors could cause regression of 1 or more scenarios. (Example: somewhat complex bug fixes, small new features)
  • Small – No issues are expected. (Example: Very small bug fixes, string changes, or configuration settings changes)

Additional information

@Veena11 Veena11 requested a review from a team as a code owner December 18, 2024 02:35
@@ -171,6 +171,8 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
*/

Choose a reason for hiding this comment

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

This pull request does not update changelog.txt.

Please consider if this change would be noticeable to a partner or user and either update changelog.txt or resolve this conversation.

@@ -171,6 +171,8 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
*/

MSIDErrorServerUnhandledResponse = -51500,
// http status Code 403 or 404
MSIDErrorUnExpectedHttpResponse = -51501,
Copy link
Member

Choose a reason for hiding this comment

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

nit: typo unexpected

Suggested change
MSIDErrorUnExpectedHttpResponse = -51501,
MSIDErrorUnexpectedHttpResponse = -51501,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

httpUnderlyingError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorUnExpectedHttpResponse, errorDescription, nil, nil, nil, context.correlationId, nil, YES);
}

NSError *httpError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorServerUnhandledResponse, errorDescription, nil, nil, httpUnderlyingError, context.correlationId, additionalInfo, YES);
Copy link
Member

Choose a reason for hiding this comment

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

Question, should the errorCode remain as MSIDErrorServerUnhandledResponse, since the MSIDErrorUnexpectedHttpResponse is now added as underlying error code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didnt change it because we want to keep the top level error same.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah, you are right, I got confused.

@Veena11 Veena11 merged commit 2143028 into dev Jan 14, 2025
10 checks passed
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