Skip to content

Commit ef4d680

Browse files
committed
update the error name
1 parent c734662 commit ef4d680

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

IdentityCore/src/MSIDError.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ typedef NS_ENUM(NSInteger, MSIDErrorCode)
172172

173173
MSIDErrorServerUnhandledResponse = -51500,
174174
// http status Code 403 or 404
175-
MSIDErrorUnExpectedHttpResponse = -51501,
175+
MSIDErrorUnexpectedHttpResponse = -51501,
176176

177177
/*!
178178
=========================================================

IdentityCore/src/MSIDError.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ MSIDErrorCode MSIDErrorCodeForOAuthErrorWithSubErrorCode(NSString *oauthError, M
225225
],
226226
MSIDHttpErrorCodeDomain : @[
227227
@(MSIDErrorServerUnhandledResponse),
228-
@(MSIDErrorUnExpectedHttpResponse)
228+
@(MSIDErrorUnexpectedHttpResponse)
229229
]
230230

231231
// TODO: add new codes here
@@ -302,8 +302,8 @@ void MSIDFillAndLogError(NSError **error, MSIDErrorCode errorCode, NSString *err
302302
// HTTP errors
303303
case MSIDErrorServerUnhandledResponse:
304304
return @"MSIDErrorServerUnhandledResponse";
305-
case MSIDErrorUnExpectedHttpResponse:
306-
return @"MSIDErrorUnExpectedHttpResponse";
305+
case MSIDErrorUnexpectedHttpResponse:
306+
return @"MSIDErrorUnexpectedHttpResponse";
307307
// Authority validation errors
308308
case MSIDErrorAuthorityValidation:
309309
return @"MSIDErrorAuthorityValidation";

IdentityCore/src/network/error_handler/MSIDAADRequestErrorHandler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ - (void)handleError:(NSError *)error
153153
NSError *httpUnderlyingError = nil;
154154
if (httpResponse.statusCode == 403 || httpResponse.statusCode == 404)
155155
{
156-
httpUnderlyingError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorUnExpectedHttpResponse, errorDescription, nil, nil, nil, context.correlationId, nil, YES);
156+
httpUnderlyingError = MSIDCreateError(MSIDHttpErrorCodeDomain, MSIDErrorUnexpectedHttpResponse, errorDescription, nil, nil, nil, context.correlationId, nil, YES);
157157
}
158158

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

IdentityCore/tests/MSIDAADRequestErrorHandlerTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ - (void)testHandleError_whenItIsNotServerError_shouldReturnStatusCodeAndHeaders
192192
XCTAssertEqualObjects(returnError.domain, MSIDHttpErrorCodeDomain);
193193
XCTAssertEqual(returnError.code, MSIDErrorServerUnhandledResponse);
194194
NSError *underlyingError = returnError.userInfo[NSUnderlyingErrorKey];
195-
XCTAssertEqual(underlyingError.code, MSIDErrorUnExpectedHttpResponse);
195+
XCTAssertEqual(underlyingError.code, MSIDErrorUnexpectedHttpResponse);
196196
XCTAssertEqualObjects(returnError.userInfo[MSIDHTTPHeadersKey], @{@"headerKey":@"headerValue"});
197197

198198
XCTAssertNil(errorResponse);
@@ -278,7 +278,7 @@ - (void)testHandleError_whenItIsServerError_shouldReturnResponseCodeInError
278278
XCTAssertEqualObjects(returnError.domain, MSIDHttpErrorCodeDomain);
279279
XCTAssertEqual(returnError.code, MSIDErrorServerUnhandledResponse);
280280
NSError *underlyingError = returnError.userInfo[NSUnderlyingErrorKey];
281-
XCTAssertEqual(underlyingError.code, MSIDErrorUnExpectedHttpResponse);
281+
XCTAssertEqual(underlyingError.code, MSIDErrorUnexpectedHttpResponse);
282282
XCTAssertEqualObjects(returnError.userInfo[MSIDHTTPResponseCodeKey], @"404");
283283
}
284284

IdentityCore/tests/integration/ios/MSIDDefaultSilentTokenRequestTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,8 @@ - (void)testAcquireTokenSilent_when403HttpCodeReturned_shouldReturnMSIDErrorUnex
13891389
XCTAssertNotNil(error);
13901390
XCTAssertNil(result);
13911391
XCTAssertEqual(error.code, MSIDErrorServerUnhandledResponse);
1392+
NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];
1393+
XCTAssertEqual(underlyingError.code, MSIDErrorUnexpectedHttpResponse);
13921394
XCTAssertEqualObjects(error.domain, MSIDHttpErrorCodeDomain);
13931395
XCTAssertEqualObjects(error.userInfo[MSIDHTTPResponseCodeKey], @"403");
13941396
[expectation fulfill];

0 commit comments

Comments
 (0)