diff --git a/packages/smithy/smithy/lib/src/http/http_operation.dart b/packages/smithy/smithy/lib/src/http/http_operation.dart index 2426f4635b..b2f5b92317 100644 --- a/packages/smithy/smithy/lib/src/http/http_operation.dart +++ b/packages/smithy/smithy/lib/src/http/http_operation.dart @@ -220,14 +220,7 @@ abstract class HttpOperation (response) => deserializeOutput( protocol: protocol, response: response, - // Prevents errors thrown from registering as "Uncaught Exceptions" - // in the Dart debugger. - // - // This is a false positive because we do catch errors in the - // retryer which wraps this. Likely this is due to the use of - // completers in `CancelableOperation` or some other Zone-related - // nonsense. - ).catchError(Error.throwWithStackTrace), + ), ); }, onCancel: () { diff --git a/packages/smithy/smithy_aws/lib/src/http/retry/aws_retryer.dart b/packages/smithy/smithy_aws/lib/src/http/retry/aws_retryer.dart index 4266e3ffee..f9d780abac 100644 --- a/packages/smithy/smithy_aws/lib/src/http/retry/aws_retryer.dart +++ b/packages/smithy/smithy_aws/lib/src/http/retry/aws_retryer.dart @@ -193,21 +193,21 @@ class AWSRetryer implements Retryer { return completer.complete(result); } on Exception catch (e) { if (!isRetryable(e)) { - rethrow; + return completer.completeError(e); } retryToken = _retrieveRetryToken(e); if (retryToken == null) { - rethrow; + return completer.completeError(e); } final delay = _delayFor(e, attempts); if (++attempts >= _maxAttempts) { - rethrow; + return completer.completeError(e); } await onRetry?.call(e, delay); await Future.delayed(delay); } } - }).catchError(completer.completeError); + }); return completer.operation; } }