errors

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 4 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 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

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

Jump to

Keyboard shortcuts

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