throw a better error on browser restart failure

This commit is contained in:
Bernard Xie 2022-11-17 14:49:42 -08:00
parent 3fee69a556
commit 4b63189917
No known key found for this signature in database
GPG key ID: 3C3E0036CE0F892C

View file

@ -332,8 +332,7 @@ func (w *watcher) compileLoop(ctx context.Context) error {
if filepath.Ext(w.outputPath) == ".png" && !w.pw.Browser.IsConnected() {
newPW, err := w.pw.RestartBrowser()
if err != nil {
w.ms.Log.Error.Printf("failed to refresh Playwright browser")
return err
return fmt.Errorf("png exporter has disconnected")
}
w.pw = newPW
}