apierrorsdeprecated

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MissingTokenDescription              = "no Authorization token was provided"
	MalformedTokenDescription            = "the provided token does not meet the required format"
	InvalidUserNameDescription           = "Unable to validate the username in the request"
	InvalidPasswordDescription           = "Unable to validate the password in the request"
	InvalidForenameErrorDescription      = "Unable to validate the user's forename in the request"
	InvalidSurnameErrorDescription       = "Unable to validate the user's surname in the request"
	InvalidErrorDescription              = "Unable to validate the email in the request"
	PasswordErrorDescription             = "failed to generate password"
	RequestErrorDescription              = "api endpoint POST user returned an error reading request body"
	UnmarshallingErrorDescription        = "api endpoint POST user returned an error unmarshalling request body"
	DuplicateEmailFound                  = "duplicate email address found"
	NewUserModelErrorDescription         = "Failed to create new user model"
	ListUsersErrorDescription            = "Error in checking duplicate email address"
	AdminCreateUserErrorDescription      = "Failed to create new user in user pool"
	MarshallingNewUserErrorDescription   = "Failed to marshall json response"
	HttpResponseErrorDescription         = "Failed to write http response"
	RequiredParameterNotFoundDescription = "error in parsing api setup arguments - missing parameter"
	InternalErrorException               = "InternalErrorException"
	MissingRefreshTokenMessage           = "no refresh token was provided"
	TokenExpiredMessage                  = "refresh token has expired"
	MissingIDTokenMessage                = "no ID token was provided"
	MalformedIDTokenMessage              = "the ID token could not be parsed"
	InternalErrorMessage                 = "an internal error has occurred"
)

Variables

View Source
var ErrDuplicateEmail = errors.New("duplicate email")
View Source
var ErrInvalidEmail = errors.New("invalid email")
View Source
var ErrInvalidForename = errors.New("invalid forename")
View Source
var ErrInvalidPassword = errors.New("invalid password")
View Source
var ErrInvalidSurname = errors.New("invalid surname")
View Source
var ErrInvalidUserName = errors.New("invalid username")
View Source
var InvalidIDTokenError = errors.New("invalid ID token")
View Source
var InvalidRefreshTokenError = errors.New("invalid refresh token")
View Source
var InvalidTokenError = errors.New("invalid token")

Functions

func HandleUnexpectedError

func HandleUnexpectedError(ctx context.Context, w http.ResponseWriter, err error, description string)

func IdentifyInternalError

func IdentifyInternalError(authErr error) (isInternalError bool)

func WriteErrorResponse

func WriteErrorResponse(ctx context.Context, w http.ResponseWriter, status int, errorResponseBody interface{})

Types

type Error

type Error struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

func IndividualErrorBuilder

func IndividualErrorBuilder(err error, description string) (apiErr Error)

type ErrorList

type ErrorList struct {
	Errors []Error `json:"errors"`
}

func ErrorResponseBodyBuilder

func ErrorResponseBodyBuilder(listOfErrors []Error) (errorResponseBody ErrorList)

Jump to

Keyboard shortcuts

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