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

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

Issue 196473016: Consider errors logged by a transformer equivalent to thrown errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | pkg/barback/lib/src/transform_node.dart » ('j') | pkg/barback/lib/src/transform_node.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/base_transform.dart
diff --git a/pkg/barback/lib/src/base_transform.dart b/pkg/barback/lib/src/base_transform.dart
index 64945ee72eaac2decbc065e04992a52302e038a1..7c9221ba52455e045242f09d321a67ade874ee7e 100644
--- a/pkg/barback/lib/src/base_transform.dart
+++ b/pkg/barback/lib/src/base_transform.dart
@@ -29,6 +29,11 @@ abstract class BaseTransform {
/// This is exposed via [BaseTransformController].
bool _consumePrimary = false;
+ /// Whether the transformer logged an error.
+ ///
+ /// This is exposed via [BaseTransformController].
+ bool _loggedError = false;
+
/// The controller for the stream of log entries emitted by the transformer.
///
/// This is exposed via [BaseTransformController].
@@ -67,6 +72,8 @@ abstract class BaseTransform {
BaseTransform(this._node) {
_logger = new TransformLogger((asset, level, message, span) {
+ if (level == LogLevel.ERROR) _loggedError = true;
+
// If the log isn't already associated with an asset, use the primary.
if (asset == null) asset = _node.primary.id;
var entry = new LogEntry(_node.info, asset, level, message, span);
@@ -123,6 +130,9 @@ abstract class BaseTransformController {
/// Whether the primary input should be consumed.
bool get consumePrimary => transform._consumePrimary;
+ /// Whether the transform logged an error.
+ bool get loggedError => transform._loggedError;
+
/// The stream of log entries emitted by the transformer during a run.
Stream<LogEntry> get onLog => transform._onLogController.stream;
« no previous file with comments | « no previous file | pkg/barback/lib/src/transform_node.dart » ('j') | pkg/barback/lib/src/transform_node.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698