Catch exceptions thrown by runChecked* when possible#36109
Catch exceptions thrown by runChecked* when possible#36109blasten merged 5 commits intoflutter:masterfrom
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception. Reviewers: Read the Tree Hygine page and make sure this patch meets those guidelines before LGTMing. /cc @dnfield |
9b2983b to
c1f06a9
Compare
|
This PR isn't changing behavior. |
Codecov Report
@@ Coverage Diff @@
## master #36109 +/- ##
==========================================
- Coverage 54.95% 54.72% -0.23%
==========================================
Files 187 187
Lines 17248 17260 +12
==========================================
- Hits 9478 9445 -33
- Misses 7770 7815 +45
Continue to review full report at Codecov.
|
jonahwilliams
left a comment
There was a problem hiding this comment.
We should still have tests to confirm that we're catch the exceptions we think we are, and responding appropriately
| await runAdbCheckedAsync(<String>[ | ||
| 'shell', 'echo', '-n', _getSourceSha1(app), '>', _getDeviceSha1Path(app), | ||
| ]); | ||
| } catch (error) { |
There was a problem hiding this comment.
Catch ProcessException only here and below.
| output = runAdbCheckedSync(<String>[ | ||
| 'shell', '-x', 'logcat', '-v', 'time', '-t', '1', | ||
| ]); | ||
| } catch (error) { |
There was a problem hiding this comment.
This should also catch ProcessException only, but that likely requires modifying _runWithLoggingSync in process.dart to throw a ProcessException instead of a String.
There was a problem hiding this comment.
I filed #36242. What about we change exception type in a separate PR?
There was a problem hiding this comment.
Sure, if you think that will make that change easier.
f86f5ab to
db9923f
Compare
db9923f to
12e56e3
Compare
Description
Catch the exceptions when possible.
Related Issues
#35929
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?