Skip to content

Commit 72c6a4b

Browse files
committed
Refactor error handling in Client connection method
- Replaced fmt.Errorf with errors.New for improved error handling in the Connect method. - Maintained consistency in error message generation for better clarity.
1 parent 20404d6 commit 72c6a4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/upstream/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package upstream
33
import (
44
"context"
55
"encoding/json"
6+
"errors"
67
"fmt"
78
"io"
89
"os/exec"
@@ -161,7 +162,7 @@ func (c *Client) Connect(ctx context.Context) error {
161162
c.logger.Debug("Connect aborted - already in progress or connected",
162163
zap.String("server", c.config.Name),
163164
zap.String("current_state", c.stateManager.GetState().String()))
164-
return fmt.Errorf(errMsg)
165+
return errors.New(errMsg)
165166
}
166167

167168
c.logger.Info("Starting connection to upstream MCP server",

0 commit comments

Comments
 (0)