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

Unified Diff: pkg/barback/lib/src/errors.dart

Issue 48483002: Remove deprecated parts of dart:async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 2 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/barback/lib/src/build_result.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/errors.dart
diff --git a/pkg/barback/lib/src/errors.dart b/pkg/barback/lib/src/errors.dart
index a240bb41a43e447d70a9430bc0e0f7aac5d2cde1..bb9af79d416245af60a316ddb9e9fd92a47692ae 100644
--- a/pkg/barback/lib/src/errors.dart
+++ b/pkg/barback/lib/src/errors.dart
@@ -115,15 +115,17 @@ class InvalidOutputException implements BarbackException {
abstract class _WrappedException implements BarbackException {
/// The wrapped exception.
final error;
+ final StackTrace stackTrace;
- _WrappedException(this.error);
+ _WrappedException(this.error, this.stackTrace);
String get _message;
String toString() {
var result = "$_message: $error";
- var stack = getAttachedStackTrace(error);
+ var stack = stackTrace;
+ if (stack == null && error is Error) stack = error.stackTrace;
if (stack != null) {
result = "$result\n${new Trace.from(stack).terse}";
}
@@ -137,8 +139,8 @@ class TransformerException extends _WrappedException {
/// The transform that threw the exception.
final TransformInfo transform;
- TransformerException(this.transform, error)
- : super(error);
+ TransformerException(this.transform, error, StackTrace stackTrace)
+ : super(error, stackTrace);
String get _message => "Transform $transform threw error";
}
@@ -150,8 +152,8 @@ class TransformerException extends _WrappedException {
class AssetLoadException extends _WrappedException {
final AssetId id;
- AssetLoadException(this.id, error)
- : super(error);
+ AssetLoadException(this.id, error, [StackTrace stackTrace])
+ : super(error, stackTrace);
String get _message => "Failed to load source asset $id";
}
« no previous file with comments | « pkg/barback/lib/src/build_result.dart ('k') | pkg/barback/lib/src/transform_node.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698