package errcode
import "github.com/99designs/gqlgen/graphql/errcode"
Index ¶
- Constants
- func RegisterErrorType(code string, kind ErrorKind)
- func Set(err error, value string)
- type ErrorKind
Constants ¶
const ( ValidationFailed = "GRAPHQL_VALIDATION_FAILED" ParseFailed = "GRAPHQL_PARSE_FAILED" )
Functions ¶
func RegisterErrorType ¶
RegisterErrorType should be called by extensions that want to customize the http status codes for errors they return
func Set ¶
Set the error code on a given graphql error extension
Types ¶
type ErrorKind ¶
type ErrorKind int
const ( // issues with graphql (validation, parsing). 422s in http, GQL_ERROR in websocket KindProtocol ErrorKind = iota // user errors, 200s in http, GQL_DATA in websocket KindUser )
func GetErrorKind ¶
get the kind of the first non User error, defaults to User if no errors have a custom extension
Source Files ¶
- Version
- v0.17.73 (latest)
- Published
- May 2, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 week ago –
Tools for package owners.