errorhandler

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorPresenter

func ErrorPresenter(ctx context.Context, err error) *gqlerror.Error

ErrorPresenter is a custom error presenter that logs the error and returns a gqlerror.Error.

func HasBadRequestError added in v0.1.14

func HasBadRequestError(gqlErrs *gqlerror.List) bool

HasBadRequestError checks if the gqlerror.List contains a bad request error.

func HasInternalError added in v0.1.14

func HasInternalError(gqlErrs *gqlerror.List) bool

HasInternalError checks if the gqlerror.List contains an internal server error.

func IsBadRequestError added in v0.1.14

func IsBadRequestError(gqlErr *gqlerror.Error) bool

IsBadRequestError checks if the gqlerror.Error is a bad request error.

func IsInternalError added in v0.1.14

func IsInternalError(gqlErr *gqlerror.Error) bool

IsInternalError checks if the gqlerror.Error is an internal server error.

func IsUnauthorizedError added in v0.1.14

func IsUnauthorizedError(gqlErr *gqlerror.Error) bool

IsUnauthorizedError checks if the gqlerror.Error is an unauthorized error.

func NewBadRequestError

func NewBadRequestError(ctx context.Context, err error) *gqlerror.Error

NewBadRequestError creates a new bad request error.

func NewBadRequestErrorWithMsg

func NewBadRequestErrorWithMsg(ctx context.Context, err error, message string) *gqlerror.Error

NewBadRequestErrorWithMsg creates a new bad request error with a message.

func NewInternalErrorWithMsg

func NewInternalErrorWithMsg(ctx context.Context, err error, message string) *gqlerror.Error

NewInternalErrorWithMsg creates a new internal server error with a message.

func NewUnauthorizedError

func NewUnauthorizedError(ctx context.Context, err error) *gqlerror.Error

NewUnauthorizedError creates a new unauthorized error.

func NewUnauthorizedErrorWithMsg

func NewUnauthorizedErrorWithMsg(ctx context.Context, err error, message string) *gqlerror.Error

NewUnauthorizedErrorWithMsg creates a new unauthorized error with a message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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