@@ -378,6 +378,13 @@ class IsolateManager {
378378 if (e.code == RpcErrorCodes .kIsolateMustBePaused) {
379379 // It's possible something else resumed the thread (such as if another
380380 // debugger is attached), we can just continue.
381+ } else if (e.code == RpcErrorCodes .kInternalError &&
382+ e.message.contains ('No running isolate (inspector is not set).' )) {
383+ // TODO(bkonyi): remove once https://github.com/flutter/flutter/issues/156793
384+ // is resolved.
385+ // It's possible during these async requests that the isolate went away
386+ // (for example a shutdown/restart) and we no longer care about
387+ // resuming it.
381388 } else {
382389 rethrow ;
383390 }
@@ -429,6 +436,13 @@ class IsolateManager {
429436 // Fallback to a regular resume if the DDS service extension isn't
430437 // available:
431438 return _resume (threadId);
439+ } else if (e.code == RpcErrorCodes .kInternalError &&
440+ e.message.contains ('No running isolate (inspector is not set).' )) {
441+ // TODO(bkonyi): remove once https://github.com/flutter/flutter/issues/156793
442+ // is resolved.
443+ // It's possible during these async requests that the isolate went away
444+ // (for example a shutdown/restart) and we no longer care about
445+ // resuming it.
432446 } else {
433447 rethrow ;
434448 }
@@ -458,6 +472,17 @@ class IsolateManager {
458472 // It's possible during these async requests that the isolate went away
459473 // (for example a shutdown/restart) and we no longer care about
460474 // pausing it.
475+ } on vm.RPCError catch (e) {
476+ if (e.code == RpcErrorCodes .kInternalError &&
477+ e.message.contains ('No running isolate (inspector is not set).' )) {
478+ // TODO(bkonyi): remove once https://github.com/flutter/flutter/issues/156793
479+ // is resolved.
480+ // It's possible during these async requests that the isolate went away
481+ // (for example a shutdown/restart) and we no longer care about
482+ // resuming it.
483+ } else {
484+ rethrow ;
485+ }
461486 }
462487 }
463488
@@ -566,6 +591,17 @@ class IsolateManager {
566591 // It's possible during these async requests that the isolate went away
567592 // (for example a shutdown/restart) and we no longer care about
568593 // configuring it. State will be cleaned up by the IsolateExit event.
594+ } on vm.RPCError catch (e) {
595+ if (e.code == RpcErrorCodes .kInternalError &&
596+ e.message.contains ('No running isolate (inspector is not set).' )) {
597+ // TODO(bkonyi): remove once https://github.com/flutter/flutter/issues/156793
598+ // is resolved.
599+ // It's possible during these async requests that the isolate went away
600+ // (for example a shutdown/restart) and we no longer care about
601+ // resuming it.
602+ } else {
603+ rethrow ;
604+ }
569605 }
570606 }
571607
@@ -928,6 +964,17 @@ class IsolateManager {
928964 // If the isolate disappeared before we sent this request, just return
929965 // null responses.
930966 return uris.map ((e) => null ).toList ();
967+ } on vm.RPCError catch (e) {
968+ if (e.code == RpcErrorCodes .kInternalError &&
969+ e.message.contains ('No running isolate (inspector is not set).' )) {
970+ // TODO(bkonyi): remove once https://github.com/flutter/flutter/issues/156793
971+ // is resolved.
972+ // If the isolate disappeared before we sent this request, just return
973+ // null responses.
974+ return uris.map ((e) => null ).toList ();
975+ } else {
976+ rethrow ;
977+ }
931978 }
932979 }
933980
0 commit comments