Skip to content

Commit 9989b27

Browse files
committed
Let logging handle error formatting
1 parent db849e9 commit 9989b27

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lib/src/generate/build_impl.dart

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,11 @@ class BuildImpl {
171171
'${result.outputs.length} outputs\n\n');
172172
} else {
173173
if (result.exception is FatalBuildException) {
174+
// TODO(???) Really bad idea. Should not set exit codes in libraries!
174175
exitCode = 1;
175176
}
176-
var exceptionString =
177-
result.exception != null ? '\n${result.exception}' : '';
178-
179-
/// For a [FatalBuildException], the message is more important than the
180-
/// stack trace so we hide it (at least for now).
181-
var stackTraceString =
182-
result.stackTrace != null && result.exception is! FatalBuildException
183-
? '\n${result.stackTrace}'
184-
: '';
185-
_logger.severe('Failed after ${watch.elapsedMilliseconds}ms'
186-
'$exceptionString$stackTraceString\n');
177+
_logger.severe('Failed after ${watch.elapsedMilliseconds}ms',
178+
result.exception, result.stackTrace);
187179
}
188180
return result;
189181
}

0 commit comments

Comments
 (0)