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

Export Cognito errors so developers can easily reference them in our code #13312

Closed
2 tasks
ffxsam opened this issue Apr 29, 2024 · 3 comments
Closed
2 tasks
Assignees
Labels
Auth Related to Auth components/category Cognito Related to cognito issues duplicate If marked with duplicate, issue will be closed & original will be added for traceability feature-request Request a new feature

Comments

@ffxsam
Copy link
Contributor

ffxsam commented Apr 29, 2024

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?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@ffxsam ffxsam added the pending-triage Issue is pending triage label Apr 29, 2024
@cwomack cwomack self-assigned this Apr 30, 2024
@cwomack cwomack added feature-request Request a new feature Auth Related to Auth components/category Cognito Related to cognito issues and removed pending-triage Issue is pending triage labels Apr 30, 2024
@cwomack
Copy link
Member

cwomack commented Apr 30, 2024

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.

@cwomack
Copy link
Member

cwomack commented Apr 30, 2024

Related to #9104

@cwomack
Copy link
Member

cwomack commented Apr 30, 2024

@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.

@cwomack cwomack closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@cwomack cwomack added the duplicate If marked with duplicate, issue will be closed & original will be added for traceability label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category Cognito Related to cognito issues duplicate If marked with duplicate, issue will be closed & original will be added for traceability feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants