Skip to content

Commit 6eb434c

Browse files
committed
Skip logging stack traces of an Exception.
1 parent cc43f83 commit 6eb434c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

build_runner/CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## 2.5.1-wip
22

3-
- Don't show stack traces if a generator throws `InvalidGenerationSourceError`
4-
from `source_gen`.
3+
- Don't log stack traces for subclasses of `Exception`.
54

65
## 2.5.0
76

build_runner_core/CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## 9.0.1-wip
22

3-
- Don't show stack traces if a generator throws `InvalidGenerationSourceError`
4-
from `source_gen`.
3+
- Don't log stack traces for subclasses of `Exception`.
54

65
## 9.0.0
76

build_runner_core/lib/src/logging/build_log.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,7 @@ class BuildLog {
414414

415415
/// Renders [message] with optional [error] and [stackTrace].
416416
///
417-
/// Drops `build_runner` exceptions that can be caused by normal user input:
418-
/// [SyntaxErrorInAssetException] and [UnresolvableAssetException].
417+
/// Skips rendering [stackTrace] if [error] is an [Exception].
419418
String renderThrowable(
420419
Object? message, [
421420
Object? error,
@@ -427,11 +426,7 @@ class BuildLog {
427426
result += '$error';
428427
}
429428

430-
if (stackTrace != null &&
431-
error is! SyntaxErrorInAssetException &&
432-
error is! UnresolvableAssetException &&
433-
// From `source_gen`, use the name to avoid a build dependency.
434-
error.runtimeType.toString() != 'InvalidGenerationSource') {
429+
if (stackTrace != null && error is! Exception) {
435430
result += '\n$stackTrace';
436431
}
437432
return result;

0 commit comments

Comments
 (0)