Skip to content

Commit

Permalink
fix: uncaught exception in smithy code (#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan-Nelson authored and NikaHsn committed Feb 1, 2024
1 parent 4e03e4f commit 623a067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 1 addition & 8 deletions packages/smithy/smithy/lib/src/http/http_operation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,7 @@ abstract class HttpOperation<InputPayload, Input, OutputPayload, Output>
(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: () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>.delayed(delay);
}
}
}).catchError(completer.completeError);
});
return completer.operation;
}
}

0 comments on commit 623a067

Please sign in to comment.