catch StateError thrown from Chromium.close#154366
catch StateError thrown from Chromium.close#154366auto-submit[bot] merged 4 commits intoflutter:masterfrom
StateError thrown from Chromium.close#154366Conversation
| }) async { | ||
| try { | ||
| return asyncGuard(() => chromeConnection.getTab(accept, retryFor: retryFor)); | ||
| } on IOException catch (error, stackTrace) { |
There was a problem hiding this comment.
Maybe this should just be a blanket on (e) catch, but I'm being conservative.
| return !chromeTab.url.startsWith('chrome-extension'); | ||
| }, | ||
| retryFor: const Duration(seconds: 5), | ||
| onError: (Object error, StackTrace stackTrace) { |
There was a problem hiding this comment.
does this now mean we're swallowing all errors?
There was a problem hiding this comment.
oh, it looks like this only gets delegated IOException and StateError?
There was a problem hiding this comment.
oh yeah. Anything that's not IOException or StateError will fall through. Maybe it should just catch everything.
There was a problem hiding this comment.
Addressed in refactor: add clarifying docs. I decided to just rename the parameter to not imply that any error would be caught.
| } on FormatException catch (ex) { | ||
| _logger.printError('Caught FormatException: $ex'); | ||
| return shelf.Response.ok('Caught exception: $ex'); | ||
| } on IOException catch (ex) { |
There was a problem hiding this comment.
Why are we not catching this here?
There was a problem hiding this comment.
This catch was introduced recently, but before I introduced getChromeTabGuarded. getChromeTabGuarded should already catch this.
Fixes crasher flutter#154203. Also does a little refactoring to move exception handling into the `getChromeTabGuarded` utility function. I plan on cherry-picking a subset of this change. This would be included in the custom CP patch for flutter#153064.
…ction.getTab` (#154380) This is a custom hotfix patch to fix #154366 and #153064 on the stable channel. The reason for a custom patch rather than a bot-created PR is that the fixes on master were done by two sequential PRs (#153978 and #154366). This CP patch is also a subset of those changes (calls to Chrome when shutting down at the end of `flutter run -d chrome`).
Fixes crasher #154203.
Also does a little refactoring to move exception handling into the
getChromeTabGuardedutility function.I plan on cherry-picking a subset of this change. This would be included in the custom CP patch for #153064.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.