Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct ResponseHandler: ResponseHandlerProtocol {
switch statusCode ?? -1 {
case 400:
throw SmartIdError.incorrectParameters
case 401:
case 401, 403:
throw SmartIdError.invalidAccessRights
case 404:
throw SmartIdError.accountNotFound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ struct ResponseHandlerTests {
}
}

@Test
func handleNetworkError_throwsInvalidAccessRightsWhenUnacceptableStatusCode403Returned() {
let afError = AFError.responseValidationFailed(reason: .unacceptableStatusCode(code: 403))

#expect(throws: SmartIdError.invalidAccessRights) {
try handler.handleNetworkError(afError, statusCode: 403)
}
}

@Test
func handleNetworkError_throwsIncorrectParametersWhenUnacceptableStatusCode400Returned() {
let afError = AFError.responseValidationFailed(reason: .unacceptableStatusCode(code: 400))
Expand Down
Loading