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

Add custom types for common errors #1058

Open
2 tasks
shepazon opened this issue Jul 5, 2023 · 2 comments
Open
2 tasks

Add custom types for common errors #1058

shepazon opened this issue Jul 5, 2023 · 2 comments
Labels
feature-request A feature should be added or improved.

Comments

@shepazon
Copy link
Contributor

shepazon commented Jul 5, 2023

Describe the feature

Due to the way many services are designed, not all errors are modeled in a way that results in types being generated for Swift automatically. Please add custom types for common errors that occur, such as the AccessDenied error returned by S3 and probably many other services.

Use Case

There are important errors you can't currently catch, such as AccessDenied. Letting developers catch these will make application development easier, and will result in more reliable and performant software for our customers.

Proposed Solution

Add the needed custom types so that errors like AccessDenied can be caught like any fully-modeled error:

do {
    let output = s3client.listBuckets(input: ListBucketsInput())
    ...
} catch let error as AccessDenied {
    // handle the access denied error by prompting the user to log in,
    // for example.
}

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@shepazon shepazon added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 5, 2023
@jbelkins jbelkins added this to the GA milestone Aug 1, 2023
@jbelkins jbelkins added needs-investigation and removed needs-triage This issue or PR still needs to be triaged. labels Aug 1, 2023
@jbelkins
Copy link
Contributor

jbelkins commented Aug 1, 2023

Look for a list of these types of unmodeled yet common errors

@smivij smivij removed this from the GA milestone Mar 7, 2024
@jbelkins
Copy link
Contributor

https://docs.aws.amazon.com/awssupport/latest/APIReference/CommonErrors.html

These are the errors which AWS says may be thrown by any service. These should be modeled as custom error types in the SDK and returned in place of an UnknownAWSHTTPServiceError.

@jbelkins jbelkins added needs-triage This issue or PR still needs to be triaged. and removed needs-investigation labels Apr 22, 2024
@dayaffe dayaffe removed the needs-triage This issue or PR still needs to be triaged. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants