Skip to content
Snippets Groups Projects
Commit 9b7cffb5 authored by nweiz@google.com's avatar nweiz@google.com Committed by Natalie Weizenbaum
Browse files

Reference SourceSpanException as well as SpanException in pub.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org//418783003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@38533 260f80e4-7a28-3924-810f-c04153c831b5
parent 1026174b
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import 'dart:io';
import 'package:path/path.dart' as p;
import 'package:source_maps/source_maps.dart';
import 'package:source_span/source_span.dart';
import 'package:stack_trace/stack_trace.dart';
import 'exceptions.dart';
......@@ -317,6 +318,8 @@ void exception(exception, [StackTrace trace]) {
// spew a stack trace on our users.
if (exception is SpanException) {
error(exception.toString(useColors: canUseSpecialChars));
} else if (exception is SourceSpanException) {
error(exception.toString(color: canUseSpecialChars));
} else {
error(getErrorMessage(exception));
}
......@@ -507,7 +510,8 @@ class _JsonLogger {
}
// If the error came from a file, include the path.
if (error is SpanException && error.span.sourceUrl != null) {
if ((error is SpanException || error is SourceSpanException) &&
error.span.sourceUrl != null) {
errorJson["path"] = p.fromUri(error.span.sourceUrl);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment