-
Notifications
You must be signed in to change notification settings - Fork 361
Ensure launchDevTools always returns success or a valid error #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note if reviewing: because I wrapped this in a try/catch, the indenting changed, which resulted in some lines wrapping, which results in a messy diff (!). If you tick the "Ignore whitespace" option in the diff settings, it'll be much easier to see the actual changes :-) |
|
Test failure appears to be an unrelated flake, kicked it and opened #622. |
|
|
||
| return {'result': Success().toJson()}; | ||
| } catch (e, s) { | ||
| return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment explaining why this exact format is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
jacob314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Hmm, looks like another flake. This change is only in the server and isn't even used by these tests (we have to explicitly rev the version in pubspec) so I'm landing this in the interests of progressing. I'll ensure the build is green before publishing the server. |

Fixes #617.
The VM service only allows us to return valid results with a
typefield, or errors. Anything else and it unregisters the service. This adds a catch-all catch block to ensure we return a well-formed error in the case of any exception (which includes the error + stack).In VS Code, we'll catch this and show the user a nicer message, with a button to show the full error/stack for reporting (most likely it'll be that the Chrome executable wasn't found).