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

Fix Wrong API Error Message #227

Closed
wants to merge 2 commits into from
Closed

Fix Wrong API Error Message #227

wants to merge 2 commits into from

Conversation

jumaallan
Copy link
Member

Story: https://app.shortcut.com/smileid/story/13459/ios-fix-wrong-message-from-the-api

Summary

A few sentences/bullet points about the changes

Known Issues

Any shortcomings in your work. This may include corner cases not correctly handled or issues related
to but not within the scope of your PR. Design compromises should be discussed here if they were not
already discussed above.

Test Instructions

Concise test instructions on how to verify that your feature works as intended. This should include
changes to the development environment (if applicable) and all commands needed to run your work.

Screenshot

If applicable (e.g. UI changes), add screenshots to help explain your work.

@jumaallan jumaallan requested a review from a team as a code owner September 6, 2024 09:36
Copy link

github-actions bot commented Sep 6, 2024

Warnings
⚠️ The source files were changed, but the tests remain unmodified. Consider updating or adding to the tests to match the source changes.
⚠️

Sources/SmileID/Classes/Networking/URLSession/URLSessionRestServiceClient.swift#L77 - Lines should not have trailing whitespace. (trailing_whitespace)

⚠️

Sources/SmileID/Classes/SmileID.swift#L113 - Function should have complexity 10 or less: currently complexity equals 11 (cyclomatic_complexity)

⚠️

Sources/SmileID/Classes/SmileID.swift#L139 - TODOs should be resolved (- Fix when Michael changes thi...). (todo)

Generated by 🚫 Danger Swift against 2ffa1eb

)?.statusCode ?? 500, httpError.error)
}
throw SmileIDError.httpError(
(urlSessionResponse.response as? HTTPURLResponse)?.statusCode ?? 500,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 500? Android doesn't have this or am I missing it? if android doesn't have it we shouldn't hard code this but rather throw the error itself for the sake of the wrappers

Copy link
Member Author

Choose a reason for hiding this comment

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

We fallback to 500 by default on iOS - this has always been the behaviour actually

Choose a reason for hiding this comment

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

Perhaps try throwing the original error instead of falling back to a default code. This might make it easier to handle edge cases without introducing misleading server errors where none exist.

@jumaallan
Copy link
Member Author

Part of #230

@jumaallan jumaallan closed this Sep 16, 2024
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.

3 participants