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

Assertion errors print poorly #1580

Closed
vsmenon opened this issue Jun 16, 2020 · 1 comment
Closed

Assertion errors print poorly #1580

vsmenon opened this issue Jun 16, 2020 · 1 comment
Labels
area-error-messaging P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@vsmenon
Copy link
Member

vsmenon commented Jun 16, 2020

The following code:

class JS {
  final String name;
  const JS([this.name]);
}

void main() {
  print(JS());
}

triggers this runtime error on the console:

Error: Assertion failed: file:///tmp/dartpadKBZCRA/main.dart:4:18

If break in the devtools debugger, it appears that:

(a) the entire error is:

Error: Assertion failed: file:///tmp/dartpadKBZCRA/main.dart:4:18
name != null
"A null value was passed into a non-nullable parameter name"

(b) there is code is dartpad that truncates everything but the first line:

              var msg = error.toString().split("\n")[0];
              console.log(msg);
@RedBrogdon RedBrogdon added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P2 A bug or feature request we're likely to work on labels Jun 27, 2020
@RedBrogdon RedBrogdon added this to the Backlog milestone Jun 27, 2020
@johnpryan
Copy link
Contributor

I'm marking this as a duplicate of #1966, where we are tracking issues related to assertion error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-error-messaging P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants