MCPcopy
hub / github.com/github/github-mcp-server / ErrorResponse

Function ErrorResponse

internal/githubv4mock/githubv4mock.go:81–91  ·  view source on GitHub ↗

ErrorResponse is the unhappy path response constructor for a mocked GraphQL request.\ Note that for the moment it is only possible to return a single error message.

(errorMsg string)

Source from the content-addressed store, hash-verified

79// ErrorResponse is the unhappy path response constructor for a mocked GraphQL request.\
80// Note that for the moment it is only possible to return a single error message.
81func ErrorResponse(errorMsg string) GQLResponse {
82 return GQLResponse{
83 Errors: []struct {
84 Message string `json:"message"`
85 }{
86 {
87 Message: errorMsg,
88 },
89 },
90 }
91}
92
93// githubv4InputStructToMap converts a struct to a map[string]any, it uses JSON marshalling rather than reflection
94// to do so, because the json struct tags are used in the real implementation to produce the variable key names,

Calls

no outgoing calls