Skip to content

Commit e24e6ff

Browse files
committed
fix(aws_common): avoid JS interop type in catch clause for Dart beta compatibility
Replace typed catch clause `on ProgressEvent catch (e)` with an untyped catch and an `is` check guarded by an ignore comment. Dart 3.12 beta reports `invalid_runtime_check_with_js_interop_types` for catch clauses that use JS interop types, since the runtime check may not be platform-consistent.
1 parent dd8831a commit e24e6ff

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/aws_common/lib/src/io/aws_file_platform_html.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ class AWSFilePlatform extends AWSFile {
179179
late http.Response response;
180180
try {
181181
response = await BrowserClient().get(Uri.parse(path));
182-
} on ProgressEvent catch (e) {
183-
if (e.type == 'error') {
182+
// ignore: avoid_catches_without_on_clauses
183+
} catch (e) {
184+
// ignore: invalid_runtime_check_with_js_interop_types
185+
if (e is ProgressEvent && e.type == 'error') {
184186
throw const InvalidFileException(
185187
message: 'Could resolve file blob from provide path.',
186188
recoverySuggestion:

0 commit comments

Comments
 (0)