Error Handling for SimpleUploadCommand #3097
-
Describe the featureIf I am not missing something it's currently not possible to notice if the SimpleUploadCommand invoked via the TransferUtility, in case a MultipartUpload is not suitable, failed or not. The HttpStatus code of the internally used PutObjectResponse is not exposed nor is an exception thrown in case of a not success status code. Use CaseBe able to check if the SimpleUploadCommand actually succeeded without having to make another S3 API call. Proposed SolutionNo response Other InformationNo response Acknowledgements
AWS .NET SDK and/or Package version usedAWSSDK.S3 3.7.205.14 Targeted .NET Platform.NET 7 Operating System and versionUbuntu |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
@lklein53 Thanks for opening feature request. Looking at SimpleUploadCommand.ExecuteAsync(), you are correct that it doesn't expose underlying Are you not getting exception in case of error from service or some environmental exception conditions? Please confirm. Thanks, |
Beta Was this translation helpful? Give feedback.
-
thanks for the quick response. Sorry my mistake, should have looked more carefully. In my tests i just mocked away the PutObject method of the client which of course will not use the S3ReponseUnmarshaller.UnmarshallException() |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
@lklein53 Thanks for opening feature request. Looking at SimpleUploadCommand.ExecuteAsync(), you are correct that it doesn't expose underlying
PutObjectResponse
object. If you check PutObject API documentation, it returns bunch of headers along with HTTP status code. In case of error from the service, SDK in this scenario, uses S3ReponseUnmarshaller.UnmarshallException() and return it to the calling code as AmazonS3Exception exception object.Are you not getting exception in case of error from service or some environmental exception conditions? Please confirm.
Thanks,
Ashish