apierror

package
v0.0.0-...-be2aeb8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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 encountered an error while processing your request. This is probably a transient error, please try again. If the error persists, contact the NAIS team.")
	ErrAppNotFound      = Errorf("We were unable to find the app you were looking for.")
	ErrAppTeamNotFound  = Errorf("NAIS Teams could not find the team which owns the application.")
	ErrTeamNotFound     = Errorf("We were unable to find the team you were looking for.")
	ErrNoEmailInSession = Errorf("No email address found in the session. This is most likely a bug in the backend. Please try again, and if the error persists, contact the NAIS team.")
	ErrUserNotFound     = func(email string) Error {
		return Errorf("We were unable to find a user with the email address you are currently signed in with: %q", email)
	}
)

Functions

func GetErrorPresenter

func GetErrorPresenter(log logrus.FieldLogger) graphql.ErrorPresenterFunc

GetErrorPresenter returns a GraphQL error presenter that filters out error messages not intended for end users. Filtered errors will be logged with the original error attached.

Types

type Error

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

Error is an error that can be presented to end-users

func Errorf

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

Errorf formats an error message for end-users. Remember not to leak sensitive information in error messages.

func (Error) Error

func (e Error) Error() string

Error returns the formatted message for end-users

Jump to

Keyboard shortcuts

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