From 4baa99e93293f2a750ca73c61cc32a2cc86c5177 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Mon, 23 Jan 2023 19:51:48 +0000 Subject: [PATCH] [observatory] Fix 'unused_catch_clause' issues This is required in order to migrate Hints to Warnings This CL migrates this code: https://dart-review.googlesource.com/c/sdk/+/279443 TESTED=presubmit Bug: https://github.com/dart-lang/sdk/issues/50796 Change-Id: I1e0c360e6ed366b6452474338679acc8b1e1399c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279458 Commit-Queue: Samuel Rawlins Reviewed-by: Ben Konyi --- runtime/observatory/lib/object_graph.dart | 6 +++--- runtime/observatory/tests/service/client_name_rpc_test.dart | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart index 47a778c2132f..ff6a2616e9ab 100644 --- a/runtime/observatory/lib/object_graph.dart +++ b/runtime/observatory/lib/object_graph.dart @@ -58,7 +58,7 @@ class _SnapshotReader implements SnapshotReader { Uint8List _newUint8Array(int size) { try { return new Uint8List(size); - } on ArgumentError catch (e) { + } on ArgumentError { // JS throws a misleading invalid argument error. Convert to a more user-friendly message. throw new Exception( "OutOfMemoryError: Not enough memory available to analyze the snapshot."); @@ -68,7 +68,7 @@ Uint8List _newUint8Array(int size) { Uint16List _newUint16Array(int size) { try { return new Uint16List(size); - } on ArgumentError catch (e) { + } on ArgumentError { // JS throws a misleading invalid argument error. Convert to a more user-friendly message. throw new Exception( "OutOfMemoryError: Not enough memory available to analyze the snapshot."); @@ -78,7 +78,7 @@ Uint16List _newUint16Array(int size) { Uint32List _newUint32Array(int size) { try { return new Uint32List(size); - } on ArgumentError catch (e) { + } on ArgumentError { // JS throws a misleading invalid argument error. Convert to a more user-friendly message. throw new Exception( "OutOfMemoryError: Not enough memory available to analyze the snapshot."); diff --git a/runtime/observatory/tests/service/client_name_rpc_test.dart b/runtime/observatory/tests/service/client_name_rpc_test.dart index 8f81da095ac2..33a0db23fca4 100644 --- a/runtime/observatory/tests/service/client_name_rpc_test.dart +++ b/runtime/observatory/tests/service/client_name_rpc_test.dart @@ -52,14 +52,14 @@ var tests = [ }, ); fail('Successfully set invalid client name'); - } on ServerRpcException catch (e) {/* expected */} + } on ServerRpcException {/* expected */} }, // Missing parameters. (VM vm) async { try { await vm.invokeRpcNoUpgrade('setClientName', {}); fail('Successfully set name with no type'); - } on ServerRpcException catch (e) {/* expected */} + } on ServerRpcException {/* expected */} }, ];