Index: sdk/lib/_internal/pub/lib/src/log.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/log.dart b/sdk/lib/_internal/pub/lib/src/log.dart |
index 6821581033d95c23e2838f1c385acf8cea37dfe3..3eb25573c89c4fb50a0b7582e43f5c12aff10ae6 100644 |
--- a/sdk/lib/_internal/pub/lib/src/log.dart |
+++ b/sdk/lib/_internal/pub/lib/src/log.dart |
@@ -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); |
} |