From faabdc247b6c80a301e51254bc8937a089493a9c Mon Sep 17 00:00:00 2001 From: David Gardiner Date: Wed, 23 Nov 2022 11:09:28 -0800 Subject: [PATCH] Fix linting error and cleanup error messages --- internal/codespaces/rpc/rpc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/codespaces/rpc/rpc.go b/internal/codespaces/rpc/rpc.go index 0014e3dffa7..4292346e2f5 100644 --- a/internal/codespaces/rpc/rpc.go +++ b/internal/codespaces/rpc/rpc.go @@ -35,12 +35,16 @@ func StartSSHServerWithOptions(ctx context.Context, session *liveshare.Session, func StartJupyterServer(ctx context.Context, session *liveshare.Session) (int, string, error) { client, err := connectToGRPCServer(ctx, session, "") + if err != nil { + return 0, "", err + } + ctx, cancel := context.WithTimeout(ctx, grpc.RequestTimeout) defer cancel() serverPort, serverUrl, err := client.StartJupyterServer(ctx) if err != nil { - return 0, "", fmt.Errorf("failed to start JupyterLab server: %w", err) + return 0, "", err } return serverPort, serverUrl, nil