errors

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithGitHubErrors

func ContextWithGitHubErrors(ctx context.Context) context.Context

ContextWithGitHubErrors updates or creates a context with a pointer to GitHub error information (to be used by middleware).

func NewGitHubAPIErrorResponse

func NewGitHubAPIErrorResponse(ctx context.Context, message string, resp *github.Response, err error) *mcp.CallToolResult

NewGitHubAPIErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware

func NewGitHubAPIErrorToCtx

func NewGitHubAPIErrorToCtx(ctx context.Context, message string, resp *github.Response, err error) (context.Context, error)

func NewGitHubAPIStatusErrorResponse added in v0.26.0

func NewGitHubAPIStatusErrorResponse(ctx context.Context, message string, resp *github.Response, body []byte) *mcp.CallToolResult

NewGitHubAPIStatusErrorResponse handles cases where the API call succeeds (err == nil) but returns an unexpected HTTP status code. It creates a synthetic error from the status code and response body, then records it in context for observability tracking.

func NewGitHubGraphQLErrorResponse

func NewGitHubGraphQLErrorResponse(ctx context.Context, message string, err error) *mcp.CallToolResult

NewGitHubGraphQLErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware

func NewGitHubGraphQLErrorToCtx added in v0.27.0

func NewGitHubGraphQLErrorToCtx(ctx context.Context, message string, err error) (context.Context, error)

func NewGitHubRawAPIErrorResponse added in v0.27.0

func NewGitHubRawAPIErrorResponse(ctx context.Context, message string, resp *http.Response, err error) *mcp.CallToolResult

NewGitHubRawAPIErrorResponse returns an mcp.NewToolResultError and retains the error in the context for access via middleware

Types

type GitHubAPIError

type GitHubAPIError struct {
	Message  string           `json:"message"`
	Response *github.Response `json:"-"`
	Err      error            `json:"-"`
}

func GetGitHubAPIErrors

func GetGitHubAPIErrors(ctx context.Context) ([]*GitHubAPIError, error)

GetGitHubAPIErrors retrieves the slice of GitHubAPIErrors from the context.

func (*GitHubAPIError) Error

func (e *GitHubAPIError) Error() string

type GitHubCtxErrors

type GitHubCtxErrors struct {
	// contains filtered or unexported fields
}

type GitHubErrorKey

type GitHubErrorKey struct{}

type GitHubGraphQLError

type GitHubGraphQLError struct {
	Message string `json:"message"`
	Err     error  `json:"-"`
}

func GetGitHubGraphQLErrors

func GetGitHubGraphQLErrors(ctx context.Context) ([]*GitHubGraphQLError, error)

GetGitHubGraphQLErrors retrieves the slice of GitHubGraphQLErrors from the context.

func (*GitHubGraphQLError) Error

func (e *GitHubGraphQLError) Error() string

type GitHubRawAPIError added in v0.27.0

type GitHubRawAPIError struct {
	Message  string         `json:"message"`
	Response *http.Response `json:"-"`
	Err      error          `json:"-"`
}

func GetGitHubRawAPIErrors added in v0.27.0

func GetGitHubRawAPIErrors(ctx context.Context) ([]*GitHubRawAPIError, error)

GetGitHubRawAPIErrors retrieves the slice of GitHubRawAPIErrors from the context.

func (*GitHubRawAPIError) Error added in v0.27.0

func (e *GitHubRawAPIError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL