Skip to content

Commit 3f24d7d

Browse files
committed
use lib/errors
1 parent f6978f7 commit 3f24d7d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/src/mcp_parse.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ package main
44
import (
55
_ "embed"
66
"encoding/json"
7-
"errors"
87
"fmt"
8+
9+
"github.com/sourcegraph/sourcegraph/lib/errors"
910
)
1011

1112
//go:embed mcp_tools.json
@@ -112,7 +113,7 @@ func (p *Parser) parseSchema(r *RawSchema) SchemaValue {
112113
if err := json.Unmarshal(r.Items, &itemRaw); err == nil {
113114
items = p.parseSchema(&itemRaw)
114115
} else {
115-
p.errors = append(p.errors, fmt.Errorf("failed to unmarshal array items: %w", err))
116+
p.errors = append(p.errors, errors.Errorf("failed to unmarshal array items: %w", err))
116117
}
117118
}
118119
}
@@ -170,7 +171,7 @@ func LoadMCPToolDefinitions(data []byte) (map[string]*MCPToolDef, error) {
170171
}
171172

172173
if len(parser.errors) > 0 {
173-
return tools, errors.Join(parser.errors...)
174+
return tools, errors.Append(nil, parser.errors...)
174175
}
175176

176177
return tools, nil

0 commit comments

Comments
 (0)