dart-pad
dart-pad copied to clipboard
Show more stack trace information
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'
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.