resperror

package
v0.0.0-...-8b6722b Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphQLErrorCodeToStatus

func GraphQLErrorCodeToStatus(code GraphQLErrorCode) int

func NewGraphQLError

func NewGraphQLError(msg string, code GraphQLErrorCode) error

NewGraphQLError creates a new GraphQLError. The message must be safe for external consumption.

Types

type GraphQLError

type GraphQLError struct {
	Msg  string
	Code GraphQLErrorCode
}

func (*GraphQLError) Error

func (graphQLError *GraphQLError) Error() string

Error implements the error interface.

type GraphQLErrorCode

type GraphQLErrorCode = string

Define GraphQL error codes.

const (
	GQLParsedFailed               GraphQLErrorCode = "GRAPHQL_PARSE_FAILED"
	GQLValidationFailed           GraphQLErrorCode = "GRAPHQL_VALIDATION_FAILED"
	GQLBadUserInput               GraphQLErrorCode = "BAD_USER_INPUT"
	GQLUnauthenticated            GraphQLErrorCode = "UNAUTHENTICATED"
	GQLForbidden                  GraphQLErrorCode = "FORBIDDEN"
	GQLPersistedQueryNotFound     GraphQLErrorCode = "PERSISTED_QUERY_NOT_FOUND"
	GQLPersistedQueryNotSupported GraphQLErrorCode = "PERSISTED_QUERY_NOT_SUPPORTED"
	GQLInternalServerError        GraphQLErrorCode = "INTERNAL_SERVER_ERROR"
)

Jump to

Keyboard shortcuts

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