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

iOS errors handling improved in order to prevent unknown codes #218

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

SpertsyanKM
Copy link
Collaborator

No description provided.

if (strCode == nil && domain == QonversionErrorDomain) {
let authErrorCodes = QNUtils.authErrorsCodes() as? [NSNumber] ?? []

if (500 <= code && code < 600) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (500 <= code && code < 600) {
if (code >= 500 && code < 600) {

let authErrorCodes = QNUtils.authErrorsCodes() as? [NSNumber] ?? []

if (500 <= code && code < 600) {
strCode = "BackendError"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
strCode = "BackendError"
strCode = apiErrorCodes[Qonversion.APIError.internalError.rawValue]

if (500 <= code && code < 600) {
strCode = "BackendError"
} else if (authErrorCodes.contains { $0.intValue == code }) {
strCode = "InvalidCredentials"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
strCode = "InvalidCredentials"
strCode = apiErrorCodes[Qonversion.APIError.invalidCredentials.rawValue]

@SpertsyanKM SpertsyanKM merged commit dd5554c into develop Aug 30, 2024
1 check passed
@SpertsyanKM SpertsyanKM deleted the tech/sc-34911/iOSerrorsHandling branch August 30, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants