Skip to content

Commit

Permalink
[observatory] Fix 'unused_catch_clause' issues
Browse files Browse the repository at this point in the history
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: #50796
Change-Id: I1e0c360e6ed366b6452474338679acc8b1e1399c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279458
Commit-Queue: Samuel Rawlins <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
  • Loading branch information
srawlins authored and Commit Queue committed Jan 23, 2023
1 parent b89568f commit 4baa99e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions runtime/observatory/lib/object_graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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.");
Expand All @@ -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.");
Expand Down
4 changes: 2 additions & 2 deletions runtime/observatory/tests/service/client_name_rpc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ var tests = <VMTest>[
},
);
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 */}
},
];

Expand Down

0 comments on commit 4baa99e

Please sign in to comment.