-
I'm building a service using the The recommended way to do this seems to be to have a wrapper around the AWS SDK However, what I'm struggling with is testing error cases. I can construct the success results easily enough, but I can't work out how to construct the error types. Is there any decent way to construct the correct error types for my mocked out API to return? Or do I need to instead be returning my own error types and doing the mapping in my wrapper? In which case, how do I test that? :) Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Right now, there isn't a way construct most of the errors the SDK returns. I think we should make it possible to construct the error types for better testing, and this has been requested in smithy-lang/smithy-rs#2208 Like you said, you can have your wrapper return your own error types, but that won't enable you to test the wrapper's error matching logic. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Right now, there isn't a way construct most of the errors the SDK returns. I think we should make it possible to construct the error types for better testing, and this has been requested in smithy-lang/smithy-rs#2208
Like you said, you can have your wrapper return your own error types, but that won't enable you to test the wrapper's error matching logic.