Skip to content

Commit 234565b

Browse files
committed
Track response.
1 parent 8fc11ae commit 234565b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/errors/error.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,16 @@ func (e *GitHubGraphQLError) Error() string {
4646
}
4747

4848
type GitHubRawAPIError struct {
49-
Message string `json:"message"`
50-
Err error `json:"-"`
49+
Message string `json:"message"`
50+
Response *http.Response `json:"-"`
51+
Err error `json:"-"`
5152
}
5253

53-
func newGitHubRawAPIError(message string, err error) *GitHubRawAPIError {
54+
func newGitHubRawAPIError(message string, resp *http.Response, err error) *GitHubRawAPIError {
5455
return &GitHubRawAPIError{
55-
Message: message,
56-
Err: err,
56+
Message: message,
57+
Response: resp,
58+
Err: err,
5759
}
5860
}
5961

@@ -149,7 +151,7 @@ func NewGitHubGraphQLErrorResponse(ctx context.Context, message string, err erro
149151
}
150152

151153
func NewGitHubRawAPIErrorResponse(ctx context.Context, message string, resp *http.Response, err error) *mcp.CallToolResult {
152-
rawAPIErr := newGitHubRawAPIError(message, err)
154+
rawAPIErr := newGitHubRawAPIError(message, resp, err)
153155
if ctx != nil {
154156
_, _ = addRawAPIErrorToContext(ctx, rawAPIErr) // Explicitly ignore error for graceful handling
155157
}

0 commit comments

Comments
 (0)