Chromium Code Reviews| 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..0ea102f0cc44718875ea569e5e15dc050af48d7a 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]); |
|
Bob Nystrom
2013/10/30 15:56:34
Let's make this non-optional, here and below.
floitsch
2013/10/30 18:39:40
Done.
|
| String get _message; |
| String toString() { |
| var result = "$_message: $error"; |
| - var stack = getAttachedStackTrace(error); |
| + var stack = stackTrace; |
| + if (satck == null && error is Error) stack = error.stackTrace; |
|
Bob Nystrom
2013/10/30 15:56:34
"satck" -> "stack"!
floitsch
2013/10/30 18:39:40
Done.
|
| 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"; |
| } |