Skip to content

[Authenticator] Allow specifying string messages for arbitrary exception types #181

@mattcreaser

Description

@mattcreaser

Before opening, please confirm:

Which UI component is this feature-request for?

Authenticator

Please include any relevant guides or documentation you're referencing

No response

Please describe your feature-request in detail.

On the Swift Authenticator, you can specify string content for any cognito error by using a specific string key, even if Authenticator itself doesn't have any logic for that case. We should implement a similar system on Android.

  1. When resolving the string content for an error scenario, first check to see if application has defined a specific string for that exception.
  2. If not, use the default string specified in Authenticator.

The list of exceptions we can expect to receive can be found here. We can transform the exception type into a string resource ID using some known algorithm, something like:

  1. Strip the "Exception" suffix
  2. Transform the remaining name to snake_case
  3. Prepend amplify_ui_authenticator_error_

This would result in e.g. ParseTokenException resolving to a string R.string.amplify_ui_authenticator_error_parse_token that could be defined in the application resources to set the content for this exception.

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

amplifyconfiguration.json

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

authenticatorThis issue relates to the Authenticator componentfeature-requestNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions