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

Unified Diff: tools/testing/dart/utils.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 | « tools/testing/dart/test_suite.dart ('k') | tools/version.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/utils.dart
diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart
index dc7924691e63af8b96972a7aad98056d2e5a6b57..ab9b8e6192901773d6c49e91d0b4db067245a7ab 100644
--- a/tools/testing/dart/utils.dart
+++ b/tools/testing/dart/utils.dart
@@ -5,6 +5,7 @@
library utils;
import 'dart:io';
+import 'dart:async' show getAttachedStackTrace;
import 'dart:utf' as utf;
class DebugLogger {
@@ -27,15 +28,25 @@ class DebugLogger {
}
}
- static void info(String msg) {
+ static String _formatErrorMessage(String msg, error) {
+ if (error == null) return msg;
+ msg += ": $error";
+ var trace = getAttachedStackTrace(error);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ return msg;
+ }
+ static void info(String msg, [error]) {
+ msg = _formatErrorMessage(msg, error);
_print("Info: $msg");
}
- static void warning(String msg) {
+ static void warning(String msg, [error]) {
+ msg = _formatErrorMessage(msg, error);
_print("Warning: $msg");
}
- static void error(String msg) {
+ static void error(String msg, [error]) {
+ msg = _formatErrorMessage(msg, error);
_print("Error: $msg");
}
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | tools/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698