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

expose a constructor func for awserr.Error types #254

Closed
sclasen opened this issue May 29, 2015 · 3 comments
Closed

expose a constructor func for awserr.Error types #254

sclasen opened this issue May 29, 2015 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@sclasen
Copy link

sclasen commented May 29, 2015

internal.apierr.New(...) should probably have a non-internal counterpart. otherwise it is quite painful to create errors to test error handling with

@jasdel
Copy link
Contributor

jasdel commented May 29, 2015

Thanks for posting this @sclasen. An additional place this pain point is returning awserr.Error compatible error when using custom credentials providers.

If we limit to the Code/Message/OrigErr fields then the New(...) constructor could be exposed via aws/awserr package. Though the awserr.RequestFailure interface would still present a pain point for the same reasons as awserr.Error. A awserr.NewRequestFailure(...) Would also make sense.

@jasdel jasdel added the feature-request A feature should be added or improved. label May 29, 2015
@sclasen
Copy link
Author

sclasen commented Jun 1, 2015

👍

jasdel added a commit that referenced this issue Jun 12, 2015
Adds two new constructors for the awserr Error types. Can also be used
for building awserr.Error for testing.

- awserr.New() returns an Error object described by code, message,
and origErr. If origErr satisfies the Error interface it will not be
wrapped within a new Error object, and will instead be returned.

- awserr.NewRequestFailure() returns a new request error wrapper for
the given Error provided.

Fixes: #254
lsegal added a commit that referenced this issue Jun 18, 2015
@jasdel
Copy link
Contributor

jasdel commented Jun 24, 2015

Thanks for suggesting this feature @sclasen. Now that the change has been pushed I'm going to go ahead and close this issue. Please let open an issue, if you have any further feedback, or issues.

@jasdel jasdel closed this as completed Jun 24, 2015
skotambkar pushed a commit to skotambkar/aws-sdk-go that referenced this issue May 20, 2021
Updates the v2 SDK to use the latest go-jmespath.

Fix aws#247
skotambkar pushed a commit to skotambkar/aws-sdk-go that referenced this issue May 20, 2021
Services
---
* Synced the V2 SDK with latests AWS service API definitions.

SDK Enhancements
---
* deps: Update SDK to latest go-jmespath ([aws#254](aws/aws-sdk-go-v2#254))

SDK Bugs
---
* `internal/ini`: Fix bug on trimming rhs spaces closes ([aws#260](aws/aws-sdk-go-v2#260))
  * Fixes a bug trimming RHS spaces not being read correctly from the ini file.
  * Fix [aws#259](aws/aws-sdk-go-v2#259)
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

2 participants