You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DAS plugins: properly throw and catch when a plugin cannot start
I noticed, when running `dart analyze`, that when `pub upgrade` could
not be run in a plugin directory, we would get the "An error occurred
while setting up ..." message (good), but then the plugin would still
be executed! And this message would get printed:
> An unexpected error was encountered by the Analysis Server.
> Please file an issue at https://github.com/dart-lang/sdk/issues/new/choose with the following details:
>
> Internal error: Issue stopping a plugin
> Bad state: Cannot stop a plugin that is not running.
The reason is that a PluginException was _only_ thrown, on line 560,
if the package config file was still _missing_. But in my case, the
plugin directory was pre-existing, from an earlier, successful run,
and so the package config file existed! So no exception was thrown,
and the server still attempted to run the plugin.
So this CL makes that whole situation much simpler, and in particular
removes the erroneous "An unexpected error was encountered by the
Analysis Server" message that we do not want to show to users, and an
extra stack trace.
Change-Id: I9be39d10b687e055392f9b81285c99cca4c57534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453140
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Samuel Rawlins <[email protected]>
0 commit comments