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

Unified Diff: pkg/stack_trace/lib/src/trace.dart

Issue 23133004: Support "..." VM frames in pkg/stack_trace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/stack_trace/lib/src/frame.dart ('k') | pkg/stack_trace/test/frame_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/lib/src/trace.dart
diff --git a/pkg/stack_trace/lib/src/trace.dart b/pkg/stack_trace/lib/src/trace.dart
index 6b7da758dba890c8abd13c9d84701764bf726674..863d64ef72a653c9232a50e361bf4391b78ca60f 100644
--- a/pkg/stack_trace/lib/src/trace.dart
+++ b/pkg/stack_trace/lib/src/trace.dart
@@ -72,14 +72,19 @@ class Trace implements StackTrace {
/// [trace] should be formatted in the same way as a Dart VM or browser stack
/// trace.
factory Trace.parse(String trace) {
- if (trace.isEmpty) return new Trace(<Frame>[]);
- if (trace.startsWith("Error\n")) return new Trace.parseV8(trace);
- if (trace.contains(_firefoxTrace)) return new Trace.parseFirefox(trace);
- if (trace.contains(_friendlyTrace)) return new Trace.parseFriendly(trace);
-
- // Default to parsing the stack trace as a VM trace. This is also hit on IE
- // and Safari, where the stack trace is just an empty string (issue 11257).
- return new Trace.parseVM(trace);
+ try {
+ if (trace.isEmpty) return new Trace(<Frame>[]);
+ if (trace.startsWith("Error\n")) return new Trace.parseV8(trace);
+ if (trace.contains(_firefoxTrace)) return new Trace.parseFirefox(trace);
+ if (trace.contains(_friendlyTrace)) return new Trace.parseFriendly(trace);
+
+ // Default to parsing the stack trace as a VM trace. This is also hit on
+ // IE and Safari, where the stack trace is just an empty string (issue
+ // 11257).
+ return new Trace.parseVM(trace);
+ } on FormatException catch (error) {
+ throw new FormatException('${error.message}\nStack trace:\n$trace');
+ }
}
/// Parses a string representation of a Dart VM stack trace.
« no previous file with comments | « pkg/stack_trace/lib/src/frame.dart ('k') | pkg/stack_trace/test/frame_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698