dart-pad icon indicating copy to clipboard operation
dart-pad copied to clipboard

Show more stack trace information

Open johnpryan opened this issue 1 year ago • 1 comments

Exceptions in DartPad should contain more information like the line number and full stack trace.

Example

This program throws a TypeError:

void main() {
  var map = <String, dynamic>{};
  String s = map['foo'];
  print(s);
}
Unhandled exception:
type 'Null' is not a subtype of type 'String'
#0      main (file:///Users/ryjohn/Desktop/foo/bin/foo.dart:3:10)
#1      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:296:19)
#2      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:189:12)

But in DartPad, only the first line is printed:

Uncaught Error: TypeError: null: type 'JSNull' is not a subtype of type 'String'

johnpryan avatar Oct 10 '23 17:10 johnpryan

Note that in preview.dartpad.dev, we now just show: Script error.; we should make sure the error handling at least matches the current dartpad.dev.

devoncarew avatar Dec 06 '23 23:12 devoncarew