diff --git a/cmd/coder/shell.go b/cmd/coder/shell.go index c7b42564..bc1c6ef4 100644 --- a/cmd/coder/shell.go +++ b/cmd/coder/shell.go @@ -126,6 +126,10 @@ func runCommand(ctx context.Context, envName string, command string, args []stri Env: cmdEnv, }) if err != nil { + var closeErr websocket.CloseError + if xerrors.As(err, &closeErr) { + return xerrors.Errorf("network error, is %q online?", envName) + } return err } @@ -157,10 +161,14 @@ func runCommand(ctx context.Context, envName string, command string, args []stri } }() err = process.Wait() - if err != nil && xerrors.Is(err, ctx.Err()) { - return xerrors.Errorf("network error, is %q online?", envName) + if err != nil { + var closeErr websocket.CloseError + if xerrors.Is(err, ctx.Err()) || xerrors.As(err, &closeErr) { + return xerrors.Errorf("network error, is %q online?", envName) + } + return err } - return err + return nil } func heartbeat(ctx context.Context, c *websocket.Conn, interval time.Duration) { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy