[flutter_tools] Allow the tool to suppress compilation errors.#58539
[flutter_tools] Allow the tool to suppress compilation errors.#58539jonahwilliams merged 6 commits intoflutter:masterfrom
Conversation
|
This also removes some of the extraneous output and newlines to simplify things a bit. For example, a compile error on startup (android) now looks like: In a separate PR, we could chop off the footer (seems fairly stable) when the error is |
| ); | ||
| if (output == null || output.errorCount != 0) { | ||
| throw Exception('Errors during snapshot creation: $output'); | ||
| throw Exception(); |
There was a problem hiding this comment.
This added nothing
| ? measurement.stackTrace | ||
| : null, | ||
| ); | ||
| if (measurement.fatal || globals.logger.isVerbose) { |
There was a problem hiding this comment.
Only show for verbose errors, actual bugs will get logged to stderr
| // Invalid state, see commented issue below for more information. | ||
| // NB: both the completeError and _badState flags are required to avoid | ||
| // filling the console with exceptions. | ||
| if (boundaryKey == null) { |
There was a problem hiding this comment.
This was fixed several months ago by @aam
| <FlutterDevice>[ | ||
| mockFlutterDevice, | ||
| ], | ||
| applicationBinary: globals.fs.file('app.apk'), |
There was a problem hiding this comment.
When there is an applicationBinary then there was no native build step, so we need to show the flutter run errors as normal
|
The xcode output is: Which is a bit better |
| List<Uri> invalidatedFiles, { | ||
| String outputPath, | ||
| PackageConfig packageConfig, | ||
| bool suppressErrors = false, |
There was a problem hiding this comment.
Can you add a comment for when you would want to suppress errors? Doesn't sound like something you would generally want to do.
There was a problem hiding this comment.
There was a problem hiding this comment.
I guess this PR is the crumb trail for the signature as to why you would want to suppress errors (so they aren't displayed twice in certain scenarios).
|
We should consider having end-to-end tests that verify the entire text of common scenarios like error messages, startup, etc, to make sure we don't accidentally regress the actual output. |
Description
suppress compilation errors on startup to make the most egregious parts of #58337 better
Specifically: