Skip to content

Commit 3fe82b7

Browse files
oprypinCommit Queue
authored and
Commit Queue
committed
Fix violations of body_might_complete_normally_catch_error hint
by converting the Future to void, seeing as the return value is not used anyway Change-Id: Ifb4fdc6f909bc0432427b0e58d59eb10a1c7a5cd Tested: only CI. Bug: #49215 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269303 Reviewed-by: Daco Harkes <[email protected]> Commit-Queue: Oleh Prypin <[email protected]>
1 parent e25e532 commit 3fe82b7

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

runtime/observatory/lib/src/elements/debugger.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,7 +2118,7 @@ class DebuggerPageElement extends CustomElement implements Renderable {
21182118
app.vm.listenEventStream(S.VM.kStdoutStream, _debugger.onStdout);
21192119
if (_stdoutSubscriptionFuture != null) {
21202120
// TODO(turnidge): How do we want to handle this in general?
2121-
_stdoutSubscriptionFuture!.catchError((e, st) {
2121+
_stdoutSubscriptionFuture!.then((_) {}, onError: (e, st) {
21222122
Logger.root.info('Failed to subscribe to stdout: $e\n$st\n');
21232123
_stdoutSubscriptionFuture = null;
21242124
});
@@ -2127,7 +2127,7 @@ class DebuggerPageElement extends CustomElement implements Renderable {
21272127
app.vm.listenEventStream(S.VM.kStderrStream, _debugger.onStderr);
21282128
if (_stderrSubscriptionFuture != null) {
21292129
// TODO(turnidge): How do we want to handle this in general?
2130-
_stderrSubscriptionFuture!.catchError((e, st) {
2130+
_stderrSubscriptionFuture!.then((_) {}, onError: (e, st) {
21312131
Logger.root.info('Failed to subscribe to stderr: $e\n$st\n');
21322132
_stderrSubscriptionFuture = null;
21332133
});

runtime/observatory/lib/src/elements/script_inset.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,8 @@ class ScriptInsetElement extends CustomElement implements Renderable {
809809
busy = true;
810810
if (line.breakpoints == null) {
811811
// No breakpoint. Add it.
812-
line.script.isolate!
813-
.addBreakpoint(line.script, line.line)
814-
.catchError((e, st) {
812+
line.script.isolate!.addBreakpoint(line.script, line.line).then((_) {},
813+
onError: (e, st) {
815814
if (e is! S.ServerRpcException ||
816815
(e as S.ServerRpcException).code !=
817816
S.ServerRpcException.kCannotAddBreakpoint) {

runtime/observatory/lib/src/service/object.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
805805
_buildIsolateList();
806806

807807
// Eagerly load the isolate.
808-
isolate.load().catchError((e, stack) {
808+
isolate.load().then((_) {}, onError: (e, stack) {
809809
Logger.root.info('Eagerly loading an isolate failed: $e\n$stack');
810810
});
811811
} else {
@@ -823,7 +823,7 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
823823
_buildIsolateGroupList();
824824

825825
// Eagerly load the isolate.
826-
isolateGroup.load().catchError((e, stack) {
826+
isolateGroup.load().then((_) {}, onError: (e, stack) {
827827
Logger.root
828828
.info('Eagerly loading an isolate group failed: $e\n$stack');
829829
});
@@ -1062,9 +1062,9 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
10621062

10631063
// Reload all isolates.
10641064
Future reloadIsolates() {
1065-
var reloads = <Future>[];
1065+
var reloads = <Future<void>>[];
10661066
for (var isolate in isolates) {
1067-
var reload = isolate.reload().catchError((e) {
1067+
var reload = isolate.reload().then((_) {}, onError: (e) {
10681068
Logger.root.info('Bulk reloading of isolates failed: $e');
10691069
});
10701070
reloads.add(reload);

0 commit comments

Comments
 (0)