-
Notifications
You must be signed in to change notification settings - Fork 880
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 ability to map AWSMobileClientError to underlying string message #1268
Comments
Thank you @medvedNick for reporting to us. @rohandubal will be reviewing the PR #1270 and will provide updates soon. |
Hello @medvedNick This is an interesting ask, to make sure we deliver it the correct way, I want to get your thoughts on couple things --
Best, |
As every case has it's associated
Or just add a
This will still make selective reporting to the user possible. |
So you're saying that we should never use these messages in UI. But what error should we display to a user when he can't log in. |
We generally avoid propagating errors intended for the end user (although as @rohandubal noted there are some legacy exceptions). This should be something that falls squarely in the app domain. That way the app can handle localization of messages, aggregation of detailed error cases into simple user message, etc. @Czajnikowski's approach would be a good start, with the addition of localization using your app's localized resources. That said... While we would not recommend these as user-facing strings, but this would still be a useful addition even for debugging and internal reporting. I'll look at getting #1270 pulled in. |
We released this in 2.10.0. Please let us know if you have any issues. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
I'd like to show user-friendly error messages received from AWSMobileClient. For instance,
I can add long switch-case for
AWSMobileClientError
enum or add the following check:but it would be great to have something like
ErrorMappingHelper
but for the opposite direction, which will convertAWSMobileClientError
to string message and will be ready to be used out-of-the-boxThe text was updated successfully, but these errors were encountered: