exceptions

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (

	//UsernameInUseErrMsg  is the error message displayed when the provided userName is associated with a profile already
	UsernameInUseErrMsg = "provided username is already in use"

	//PhoneNumberInUseErrMsg is the error message displayed when a phone number provided is associated with a profile already
	PhoneNumberInUseErrMsg = "provided phone number is already in use"

	//EmailInUseErrMsg is the error message displayed when a email provided is associated with a profile already
	EmailInUseErrMsg = "provided email address is already in use"

	// UserNotFoundErrMsg is the error message displayed when a user is not found
	UserNotFoundErrMsg = "failed to get a user"

	// ProfileNotFoundErrMsg is the error message displayed when a user is not found
	ProfileNotFoundErrMsg = "failed to get a user profile"

	// ProfileSuspenedFoundErrMsg is the error message displayed when a user's profile has been suspended
	ProfileSuspenedFoundErrMsg = "the user profile has been suspended"

	// PINNotFoundErrMsg is the error message displayed when a pin is not found
	PINNotFoundErrMsg = "failed to get a user pin"

	// CustomTokenErrMsg is the error message displayed when a
	// custom token is not created
	CustomTokenErrMsg = "failed to create custom token"

	// AuthenticateTokenErrMsg is the error message displayed when a
	// custom token is not authenticated
	AuthenticateTokenErrMsg = "failed to authenticate custom token"

	// UpdateProfileErrMsg is the error message displayed when a
	// user profile cannot be updated
	UpdateProfileErrMsg = "failed to update a user profile"

	// AddRecordErrMsg is the error message displayed when a
	// record fails to be added to the database
	AddRecordErrMsg = "failed to add the record to the database"

	// LikelyToRecommendErrMsg is the error message displayed that
	// occurs when the recommendation threshold is crossed
	LikelyToRecommendErrMsg = "the likelihood of recommending should be an int between 0 and 10"

	// ValidatePINLengthErrMsg  is the error message displayed when
	// an invalid Pin length is given
	ValidatePINLengthErrMsg = "pin should be of 4,5, or six digits"

	// ValidatePINDigitsErrMsg  is the error message displayed when
	// an invalid  pin digits are given
	ValidatePINDigitsErrMsg = "pin should be a valid number"

	// UsePinExistErrMsg  is the error message displayed when
	// user has pin already during set pin
	UsePinExistErrMsg = "the user has PIN already"

	// EncryptPINErrMsg  is the error message displayed when
	// pin encryption fails
	EncryptPINErrMsg = "unable to encrypt PIN"

	// RetrieveRecordErrMsg is the error message displayed when a
	// record fails to be retrieved from database
	RetrieveRecordErrMsg = "unable to retrieve newly created record"

	// ExistingPINErrMsg is the error message displayed when a
	// pin record fails to be retrieved from database
	ExistingPINErrMsg = "user does not have an existing PIN"

	// CheckUserPINErrMsg is the error message displayed when
	// server unable to check if the user has a PIN
	CheckUserPINErrMsg = "unable to check if the user has a PIN"

	// GenerateAndSendOTPErrMsg is the error message displayed when a
	// generate and send otp fails
	GenerateAndSendOTPErrMsg = "failed to generate and send an otp"

	// NormalizeMSISDNErrMsg is the error message displayed when
	// normalize the msisdn(phone number) fails
	NormalizeMSISDNErrMsg = "unable to normalize the msisdn"

	// PINMismatchErrMsg is the error message displayed when
	// the user supplied PIN number does not match the PIN
	// record we have stored
	PINMismatchErrMsg = "wrong PIN credentials supplied"

	// InternalServerErrorMsg is an error message for database CRUD operations that
	// don't succeed e.g network latency
	InternalServerErrorMsg = "server error! unable to perform operation"

	// ValidatePushTokenLengthErrMsg ...
	ValidatePushTokenLengthErrMsg = "invalid push token detected"

	// WrongEnumErrMsg is an error message returned when a wrong enum
	// type is supplied
	WrongEnumErrMsg = "a wrong enum %s has been provided"

	// OTPVerificationErrMsg is an error message that is returned when
	// a given OTP code and Phone number fails verifciation
	OTPVerificationErrMsg = "failed to verify OTP"

	// InvalidFlavourDefinedErrMsg for invalid flavour definitions
	InvalidFlavourDefinedErrMsg = "invalid flavour defined"

	// InvalidCredentialsErrMsg is displayed when wrong credentials are provided
	InvalidCredentialsErrMsg = "invalid credentials, expected a username AND password"

	// SaveUserPinErrMsg is displayed when a user pin is not saved
	SaveUserPinErrMsg = "unable to save user PIN"

	// GeneratePinErrMsg is displayed when a user pin is not generated
	GeneratePinErrMsg = "unable to generate temporary PIN for new user"

	// BioDataErrMsg is displayed when a user BioData is incomplete
	BioDataErrMsg = "incomplete Bio Data, expected first and last name"

	// ResourceUpdateErrMsg is throw when trying to update a resource with empty arguments
	ResourceUpdateErrMsg = "can't update resource with empty arguments"

	// ResolveNudgeErrMsg is displayed when a nudge fails to be resolved
	// It takes the `flavour` and a `name` of the nudge to be more specific
	ResolveNudgeErrMsg = "failed to resolve %v `%s` nudge"

	// ResolveNudgeBadStatusErrMsg is displayed when a nudge fails to be resolved
	// because of an unexpected `Status code` being returned
	// It takes the `flavour`, `name` and a `StatusCode` f orthe nudge to be more specific
	ResolveNudgeBadStatusErrMsg = "failed to resolve %v `%s` nudge with status code %v"

	// RecordExistsErrMsg is the error message displayed an existing record is found
	RecordExistsErrMsg = "a similar record has been found in the database"

	// RecordDoesNotExistErrMsg is the error message displayed when a record cannot be found in
	// the database
	RecordDoesNotExistErrMsg = "the record cannot be found in the database"

	//RoleNotValidMsg is an error message displayed when the provided role is not valid
	// and the user doesn't have permissions to perform an action
	RoleNotValidMsg = "user role is not valid"

	//NavActionsError is an error message displayed when the system cannot update navigation actions
	NavActionsError = "navigation actions not updated"
)

Variables

This section is empty.

Functions

func AddRecordError

func AddRecordError(err error) error

AddRecordError is the error message displayed when a record fails to be added to the dataerrorcodeutil

func AuthenticateTokenError

func AuthenticateTokenError(err error) error

AuthenticateTokenError is the error message displayed when a custom token is not authenticated

func CheckEmailExistError

func CheckEmailExistError() error

CheckEmailExistError returned when the provided email already exists.

func CheckPhoneNumberExistError

func CheckPhoneNumberExistError() error

CheckPhoneNumberExistError check if phone number is registered to another user

func CheckUserPINError

func CheckUserPINError(err error) error

CheckUserPINError is the error message displayed when a server is unable to check if the user has a PIN

func CompleteSignUpError

func CompleteSignUpError(err error) error

CompleteSignUpError returns an error message when we are unable to CompleteSignup

func CustomTokenError

func CustomTokenError(err error) error

CustomTokenError is the error message displayed when a custom token is not created

func EncryptPINError

func EncryptPINError(err error) error

EncryptPINError is the error message displayed when pin encryption fails

func ExistingPINError

func ExistingPINError(err error) error

ExistingPINError is the error message displayed when a pin record fails to be retrieved from dataerrorcodeutil

func GenerateAndSendOTPError

func GenerateAndSendOTPError(err error) error

GenerateAndSendOTPError is the error message displayed when a generate and send otp fails

func GeneratePinError

func GeneratePinError(err error) error

GeneratePinError returns an error message when we are unable to generate a temporary PIN

func InValidPushTokenLengthError

func InValidPushTokenLengthError() error

InValidPushTokenLengthError is the error message displayed when an invalid push token is given

func InternalServerError

func InternalServerError(err error) error

InternalServerError returns an error if something wrong happened in performing the operation

func InvalidCredentialsError

func InvalidCredentialsError() error

InvalidCredentialsError returns an error message when wrong credentials are provided

func InvalidFlavourDefinedError

func InvalidFlavourDefinedError() error

InvalidFlavourDefinedError is the error message displayed when an invalid flavour is provided as input.

func LikelyToRecommendError

func LikelyToRecommendError(err error) error

LikelyToRecommendError is the error message displayed that occurs when the recommendation threshold is crossed

func MissingInputError

func MissingInputError(value string) error

MissingInputError returns an error when OTP verification fails

func NavigationActionsError(err error) error

NavigationActionsError return an error when user navigation actions can not be manipulated

func NormalizeMSISDNError

func NormalizeMSISDNError(err error) error

NormalizeMSISDNError returns an error when normalizing the msisdn fails

func PinMismatchError

func PinMismatchError(err error) error

PinMismatchError displays an error when the supplied PIN does not match the PIN stored

func PinNotFoundError

func PinNotFoundError(err error) error

PinNotFoundError displays error message when a pin is not found

func ProfileNotFoundError

func ProfileNotFoundError(err error) error

ProfileNotFoundError returns an error message when a profile is not found

func ProfileSuspendFoundError

func ProfileSuspendFoundError() error

ProfileSuspendFoundError is returned is the user profile has been suspended.

func RecordDoesNotExistError

func RecordDoesNotExistError(err error) error

RecordDoesNotExistError is the error message displayed when a record is not found in the DB

func RecordExistsError

func RecordExistsError(err error) error

RecordExistsError is the error message displayed when a similar record is found in the DB

func ResolveNudgeErr

func ResolveNudgeErr(
	err error,
	flavour feedlib.Flavour,
	name string,
	statusCode *int,
) error

ResolveNudgeErr is the error that represents the failure of not being able to resolve a given nudge

func RetrieveRecordError

func RetrieveRecordError(err error) error

RetrieveRecordError is the error message displayed when a failure occurs while retrieving records from the dataerrorcodeutil

func RoleNotValid

func RoleNotValid(err error) error

RoleNotValid return an error when a user does not have the required role

func SaveUserPinError

func SaveUserPinError(err error) error

SaveUserPinError returns an error message when we are unable to save a user pin

func SecondaryResourceHardResetError

func SecondaryResourceHardResetError() error

SecondaryResourceHardResetError this error is returned when there argument to reset a resource has a length of 0 resource here means secondary phone numbers and secondary emails

func UpdateProfileError

func UpdateProfileError(err error) error

UpdateProfileError is the error message displayed when a user profile cannot be updated

func UserNotFoundError

func UserNotFoundError(err error) error

UserNotFoundError returns an error message when a user is not found

func UsernameInUseError

func UsernameInUseError() error

UsernameInUseError is the error message displayed when the provided username is associated with another profile

func ValidatePINDigitsError

func ValidatePINDigitsError(err error) error

ValidatePINDigitsError is the error message displayed when invalid pin digits are given

func ValidatePINLengthError

func ValidatePINLengthError(err error) error

ValidatePINLengthError is the error message displayed when an invalid Pin length is given

func VerifyOTPError

func VerifyOTPError(err error) error

VerifyOTPError returns an error when OTP verification fails

func WrongEnumTypeError

func WrongEnumTypeError(value string) error

WrongEnumTypeError is the error message displayed when an invalid enum is given

Types

This section is empty.

Jump to

Keyboard shortcuts

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