Open vancefunraise opened 1 month ago
Hi @vancefunraise, thanks for your question. Let me double check with my team and will get back to you soon.
So the intention of the exception message is for you, the developer, to use it to determine what to do. You can use it to for metrics or logs but it's not best to show them to the user (for one thing, the string isn't localized!). What you ultimately show to the user is up to you if you want to obfuscate it so, as you suggested, you can parse the exception and display your own error copy.
We don't suggest displaying the raw exception message for the same reason as you suggested and, at the very least, it's not a localized string.
If it would help, here are a list of the Exceptions you can expect to encounter when dealing with auth: https://github.com/aws-amplify/amplify-android/tree/main/core/src/main/java/com/amplifyframework/auth/exceptions
Before opening, please confirm:
Language and Async Model
Kotlin, RxJava
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Android app using cognito auth
I'm unsure of what error message I can propagate from Amplify to my user upon RxAmplify onError calls.
In the above example using
RxAmplify.Auth.resetPassword(username)
with a known unused username, we get an exception as expected. I could be missing something simple, but what is unclear to me, is which message should be shown to the user.RxAmplify.Auth.signIn(username, password)
)cause
same thingShould we expect to use any of these error messages in the exception object universally (ie my class that wraps amplify Rx calls can always expect the
cause
to have the error message i want to display in the UI) or should we somehow be parsing these exception types and supplying our own error copy?Reproduction steps (if applicable)
No response
Code Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response