Skip to content

Hot Restart does not complete if exceptions are hit during the restart #3448

@tjx666

Description

@tjx666

Describe the bug

First, check the All Exceptions and Uncaught Exceptions setting at debug panel.

Then debug the following example code. When debugger stoped at exception in function a, press continue button, the debugger will stoped at catch block in function b. Finally, click restart button, debugger will run into endless waiting.

import 'package:flutter/material.dart';

void a() {
  throw Exception('a');
}

void b() {
  try {
    a();
  } catch (e) {
    throw Exception('b');
  }
}

void c() {
  try {
    b();
  } catch (e) {
    throw Exception('c');
  }
}

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    c();
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Study Flutter',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: Container(),
    );
  }
}

image

Expected behavior

After I click the restart button, debugger should stopped at exception in function a

Versions (please complete the following information):

  • VS Code version: 1.58.0-insider
  • Dart extension version: 2.2.0
  • Dart/Flutter SDK version: 3.23.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions