Skip to content

Commit ec2ddbf

Browse files
fix: uncaught exception in smithy code (#4369)
1 parent c2f63ad commit ec2ddbf

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

packages/smithy/smithy/lib/src/http/http_operation.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,7 @@ abstract class HttpOperation<InputPayload, Input, OutputPayload, Output>
220220
(response) => deserializeOutput(
221221
protocol: protocol,
222222
response: response,
223-
// Prevents errors thrown from registering as "Uncaught Exceptions"
224-
// in the Dart debugger.
225-
//
226-
// This is a false positive because we do catch errors in the
227-
// retryer which wraps this. Likely this is due to the use of
228-
// completers in `CancelableOperation` or some other Zone-related
229-
// nonsense.
230-
).catchError(Error.throwWithStackTrace),
223+
),
231224
);
232225
},
233226
onCancel: () {

packages/smithy/smithy_aws/lib/src/http/retry/aws_retryer.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,21 @@ class AWSRetryer implements Retryer {
193193
return completer.complete(result);
194194
} on Exception catch (e) {
195195
if (!isRetryable(e)) {
196-
rethrow;
196+
return completer.completeError(e);
197197
}
198198
retryToken = _retrieveRetryToken(e);
199199
if (retryToken == null) {
200-
rethrow;
200+
return completer.completeError(e);
201201
}
202202
final delay = _delayFor(e, attempts);
203203
if (++attempts >= _maxAttempts) {
204-
rethrow;
204+
return completer.completeError(e);
205205
}
206206
await onRetry?.call(e, delay);
207207
await Future<void>.delayed(delay);
208208
}
209209
}
210-
}).catchError(completer.completeError);
210+
});
211211
return completer.operation;
212212
}
213213
}

0 commit comments

Comments
 (0)