Skip to content

Commit

Permalink
handle error for plugin that exits before ping established
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Oct 11, 2024
1 parent a30b52a commit 8e32669
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/buildengine/languageplugin/external_plugin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ func (p *externalPluginImpl) start(ctx context.Context, bind *url.URL, language
close(pingErr)
}()

// Wait for ping result, or for the plugin to exit. Which ever happens first.
select {
case err := <-cmdErr:
if err == nil {
return fmt.Errorf("plugin exited with status 0 before ping was registered")
}
return err
case err := <-pingErr:
if err != nil {
Expand Down

0 comments on commit 8e32669

Please sign in to comment.