Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions in Dart web apps pause with "PauseInterrupted" instead of "PauseException" #2381

Open
DanTup opened this issue Mar 7, 2024 · 0 comments
Labels
P3 A lower priority bug or feature request package:dwds triaged

Comments

@DanTup
Copy link
Contributor

DanTup commented Mar 7, 2024

Given a simple Dart web app created with dart create -t web and the code updated to:

import 'dart:html';

Future<void> main() async {
  // TODO: Remove this delay when breakpoints in startup code work
  // https://github.com/dart-lang/webdev/issues/830
  await Future.delayed(const Duration(seconds: 1));

  methodThatThrows();
  querySelector('#output')!.text = 'Your Dart app is running.';
}

void methodThatThrows() {
  throw Exception("Oops");
}

When the exception is triggered, the pause event is PauseInterrupted instead of PauseException:

{
	"jsonrpc": "2.0",
	"method": "streamNotify",
	"params": {
		"streamId": "Debug",
		"event": {
			"type": "Event",
			"kind": "PauseInterrupted",
			"timestamp": 1709810801870,
			"isolate": {
				"type": "@Isolate",
				"id": "1",
				"number": "1",
				"name": "main()",
				"isSystemIsolate": false,
				"isolateGroupId": ""
			},
			"topFrame": {
				"type": "Frame",
				"index": 21,
				"code": {
					"type": "@Code",
					"id": "3",
					"name": "main$",
					"kind": "Dart"
				},
				"location": {
					"type": "SourceLocation",
					"script": {
						"type": "@Script",
						"id": "2",
						"uri": "org-dartlang-app:///web/main.dart"
					},
					"tokenPos": 1339,
					"line": 6,
					"column": 16
				},
				"kind": "AsyncCausal"
			}
		}
	}
}
@elliette elliette added the P3 A lower priority bug or feature request label Mar 7, 2024
@bkonyi bkonyi added the triaged label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:dwds triaged
Projects
None yet
Development

No branches or pull requests

3 participants