Closed ffxsam closed 2 weeks ago
Hey there, @ffxsam and thank you for creating this issue. We'll mark it as a feature request and review it with the team internally, but seems pretty straightforward. Exposing both the types and the errors would be useful since we currently wrap all uncategorized service errors.
Related to #9104
@ffxsam, I've review this with the team internally and we'd like to consolidate this feature request into the existing/older #9104 referenced above. Please feel free to leave any additional comments/context in that issue as needed, but we've captured the details in this one as a criteria for success/implementation for this feature on our side.
Is this related to a new or existing framework?
No response
Is this related to a new or existing API?
Authentication
Is this related to another service?
No response
Describe the feature you'd like to request
It would be great if we could have access (import) the various Cognito exceptions here: https://github.com/aws-amplify/amplify-js/blob/7ddca1bc9fa9d991259466b2d1e391cede1c206d/packages/auth/src/providers/cognito/types/errors.ts
This way, we can have better type safety in our own code, and auto-complete to get a comprehensive list of all possible errors for the various Auth functions.
Describe the solution you'd like
Please export these exceptions so they're available to import from
aws-amplify/auth
.Describe alternatives you've considered
Copying and pasting these errors into our own codebase. This isn't ideal, just in case an AWS developer changes or adds new exceptions.
Additional context
No response
Is this something that you'd be interested in working on?