Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: sdk/lib/_internal/pub/lib/src/log.dart

Issue 418103004: Add an http_throttle package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/http_throttle/test/http_throttle_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « pkg/http_throttle/test/http_throttle_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698