コード例 #1
0
 public async Task Cleanup(Func <IAmazonS3, Task> action)
 {
     try
     {
         await _inner.Cleanup(action);
     }
     catch (OperationCanceledException exception)
     {
         throw new TimeoutException("S3 cleanup operation timed out.", exception);
     }
 }
コード例 #2
0
 public async Task Cleanup(Func <IAmazonS3, Task> action)
 {
     try
     {
         await _inner.Cleanup(action);
     }
     catch (AmazonServiceException exception) when(exception.InnerException is WebException webException && webException.Status == WebExceptionStatus.RequestCanceled)
     {
         throw new OperationCanceledException("Amazon service exception treated as cleanup cancellation.", exception);
     }
     catch (AmazonS3Exception exception) when(exception.StatusCode == HttpStatusCode.ServiceUnavailable)
     {
         throw new OperationCanceledException("S3 \"service unavailable\" exception treated as cleanup cancellation.", exception);
     }
 }
コード例 #3
0
 public Task Cleanup(Func <IAmazonS3, Task> action)
 => _inner.Cleanup(action);