apierror

package
v0.0.0-...-96f7096 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotExists       = Errorf("The user does not exist.")
	ErrTeamSlug            = Errorf("Your team identifier does not fit our requirements. Team identifiers must contain only lowercase alphanumeric characters or hyphens, contain at least 3 characters and at most 30 characters, start with an alphabetic character, end with an alphanumeric character, and not contain two hyphens in a row.")
	ErrInternal            = Errorf("The server errored out while processing your request, and we didn't write a suitable error message. You might consider that a bug on our side. Please try again, and if the error persists, contact the NAIS team.")
	ErrDatabase            = Errorf("The database system encountered an error while processing your request. This is probably a transient error, please try again. If the error persists, contact the NAIS team.")
	ErrTeamPurpose         = Errorf("You must specify the purpose for your team. This is a human-readable string which is used in external systems, and is important because other people might need to to understand what your team is all about.")
	ErrTeamNotExist        = Errorf("The team you are referring to does not exist in our database.")
	ErrTeamPrefixRedundant = Errorf("The name prefix 'team' is redundant. When you create a team, it is by definition a team. Try again with a different name, perhaps just removing the prefix?")
	ErrTeamSlugReserved    = Errorf("The specified slug is reserved by the platform.")
	ErrUserIsNotTeamMember = Errorf("The user is not a member of the team.")
)

Functions

func GetErrorPresenter

func GetErrorPresenter(log logger.Logger) graphql.ErrorPresenterFunc

GetErrorPresenter returns a GraphQL error presenter that filters out error messages not intended for end users. All filtered errors are logged.

Types

type Error

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

func Errorf

func Errorf(format string, args ...any) Error

Errorf formats an error message for API users. This message will probably be read by a human being, format it accordingly and don't leak information!

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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