exceptions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

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

	// 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"

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

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

	// InvalidResetPinPayloadErrorMsg is displayed when a pin payload is invalid
	InvalidResetPinPayloadErrorMsg = "failed to validate reset pin payload"

	// EmptyUserIDInputErrorMsg is displayed when a user id input is empty
	EmptyUserIDInputErrorMsg = "user id input is empty"

	// ProfileNotFoundErrorMsg is displayed when a profile is not found
	ProfileNotFoundErrorMsg = "user profile not found"

	// StaffProfileNotFoundErrorMsg is displayed when a staff profile is not found
	StaffProfileNotFoundErrorMsg = "staff profile not found"

	// InvalidatePinErrMsg is displayed when the invalidate action for reset pin fails
	InvalidatePinErrMsg = "unable to invalidate reset pin"

	// ResetPinErrorMsg is displayed when the reset pin action fails
	ResetPinErrorMsg = "unable to reset pin"

	// PINExpiredErrorMsg is the error message displayed when a PIN is expired
	PINExpiredErrorMsg = "pin expired"

	// EmptyInputErrorMsg is the error message displayed when an input is empty
	EmptyInputErrorMsg = "input is empty"

	// PINErrorMsg is the error message displayed when a PIN is invalid
	PINErrorMsg = "invalid pin"

	// NotOptedInErrorMsg  is the error message displayed when a user is not opted in
	NotOptedInErrorMsg = "user not opted in"

	// NotActiveErrorMsg  is the error message displayed when a field is not active
	NotActiveErrorMsg = "field active is false"

	// InvalidContactTypeErrorMsg is the error message displayed when a contact type is invalid
	InvalidContactTypeErrorMsg = "invalid contact type"

	// NoContactsErrorMsg is the error message displayed when a user has no contacts
	NoContactsErrorMsg = "user has no contacts"

	// ContactNotFoundErrorMsg is the error message displayed when a contact is not found
	ContactNotFoundErrorMsg = "contact not found"

	// GenerateTempPINErrMsg is the error message displayed when a temp pin is not generated
	GenerateTempPINErrMsg = "unable to generate temporary pin"

	// ExpiredPinErrorMsg is the error message displayed when a pin is expired
	ExpiredPinErrorMsg = "pin expired"

	// LoginCountUpdateErrorMsg is the error message displayed when a login count update fails
	LoginCountUpdateErrorMsg = "unable to update login count"

	// LoginTimeUpdateErrorMsg is the error message displayed when a login time update fails
	LoginTimeUpdateErrorMsg = "unable to update login time"

	// NexAllowedLOginTimeErrorMsg is the error message displayed when a login time is not allowed
	NexAllowedLOginTimeErrorMsg = "login time not allowed"

	// SendSMSErrorMsg is the error message displayed when a SMS is not sent
	SendSMSErrorMsg = "unable to send SMS"

	// FailedToUpdateItemErrorMsg is the error message displayed when an item is not updated
	FailedToUpdateItemErrorMsg = "failed to update item"

	// ItemNotFoundErrorMsg is the error message displayed when an item is not found
	ItemNotFoundErrorMsg = "item not found"

	// InputValidationErrorMsg is the error message displayed when an input is invalid
	InputValidationErrorMsg = "input validation failed"

	// EncryptionErrorMsg is the error message displayed when an encryption fails
	EncryptionErrorMsg = "encryption failed"

	// FailedToSaveItemErrorMsg is the error message displayed when an item is not saved
	FailedToSaveItemErrorMsg = "failed to save item"

	// GeneratePinErrorMsg is the error message displayed when a pin is not generated
	GeneratePinErrorMsg = "unable to generate pin"

	// GetInviteLinkErrorMsg is the error message displayed when an invite link is not generated
	GetInviteLinkErrorMsg = "unable to generate invite link"

	// ValidatePINDigitsErrorMsg is the error message displayed when a pin is invalid
	ValidatePINDigitsErrorMsg = "invalid pin digits"

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

	// ClientProfileNotFoundErrorMsg is displayed when a profile is not found
	ClientProfileNotFoundErrorMsg = "client profile not found"

	// ClientCCCIdentifierNotFoundErrorMsg is displayed when a clients CCC number identifier is not found
	ClientCCCIdentifierNotFoundErrorMsg = "client ccc identifier not found"

	// InternalErrorMsg is the error message displayed when an internal server error occurs
	InternalErrorMsg = "internal error"

	// UpdateClientCaregiverErrorMsg is the error message displayed when a caregiver is not updated
	UpdateClientCaregiverErrorMsg = "unable to update caregiver"

	// CreateClientCaregiverErrorMsg is the error message displayed when a caregiver is not created
	CreateClientCaregiverErrorMsg = "unable to create caregiver"

	// GetLoggedInUserUIDErrorMsg is the error message displayed when a logged in user uid is not found
	GetLoggedInUserUIDErrorMsg = "unable to get logged in user uid"

	// CheckUserRoleErrorMsg is the error message displayed when a user role is not found
	CheckUserRoleErrorMsg = "unable to check user role"

	// UserNotAuthorizedErrorMsg is the error message displayed when a user is not authorized
	UserNotAuthorizedErrorMsg = "user not authorized"

	// CheckUserPermissionErrorMsg is the error message displayed when a user permission is not found
	CheckUserPermissionErrorMsg = "unable to check user permission"
	//AssignRolesErrorMsg is the error message displayed when a user role assignment fails
	AssignRolesErrorMsg = "unable to assign roles"
	// GetUserRolesErrorMsg is the error message displayed when a user role is not found
	GetUserRolesErrorMsg = "unable to get user roles"
	// GetUserPermissionsErrorMsg is the error message displayed when a user permission is not found
	GetUserPermissionsErrorMsg = "unable to get user permissions"

	// RevokeRolesErrorMsg is the error message displayed when a user roles' revocation fails
	RevokeRolesErrorMsg = "unable to revoke roles"

	// NickNameExistsErrorMsg is the error message displayed when a user attempts to set a nickname that
	// has already been taken
	NickNameExistsErrorMsg = "username has already been taken"

	// ClientHasUnresolvedPinResetRequestErrorMsg is the error message displayed when a client has an unresolved pin reset request
	ClientHasUnresolvedPinResetRequestErrorMsg = "client has unresolved pin reset request"

	// RetryLoginErrorMsg is the error message displayed when a user attempts to login when they have exponential backoff
	RetryLoginErrorMsg = "retry login failed due to exponential backoff"

	// GetAllRolesErrorMsg is the error message displayed when a user role is not found
	GetAllRolesErrorMsg = "unable to query all roles"

	// RecordNotFoundErrorMsg is the error message displayed when a record is not found
	RecordNotFoundErrorMsg = "record not found"

	// FailedSecurityCountExceededErrorMsg is the error message displayed when a user has failed security count
	FailedSecurityCountExceededErrorMsg = "you have reached the maximum number of attempts"

	// SecurityQuestionResponseMismatchErrorMsg is the error message displayed when a user's security question response does not match
	SecurityQuestionResponseMismatchErrorMsg = "security question response does not match"

	// SecurityQuestionNotFoundErrorMsg is the error message displayed when a user's security question is not found
	SecurityQuestionNotFoundErrorMsg = "security question not found"

	// UpdateProfileErrorMsg is the error message displayed when a user's profile is not updated
	UpdateProfileErrorMsg = "unable to update profile"

	// StaffHasUnresolvedPinResetRequestErrorMsg is the error message displayed when a staff has an unresolved pin reset request
	StaffHasUnresolvedPinResetRequestErrorMsg = "staff has unresolved pin reset request"

	// FailedToCreateAnOrganizationErrorMsg is the error message displayed when an organization is not created
	FailedToCreateAnOrganizationErrorMsg = "failed to create an organization"

	// DuplicateOrganisationCodeErrorMessage is the error message to be displayed when an existing organisation code is used to register a new organisation
	DuplicateOrganisationCodeErrorMessage = "the provided organisation code is associated with another organisation"

	// DuplicateOrganisationNameErrorMessage is the error message to be displayed when an existing organisation name is used to create a new organisation
	DuplicateOrganisationNameErrorMessage = "the provided name is associated with another organisation"

	// DuplicateOrganisationPhoneNumberErrorMessage is the error message to be displayed when an existing phone number is used to create a new organisation
	DuplicateOrganisationPhoneNumberErrorMessage = "the provided phone number is associated with another organisation"

	// DuplicateOrganisationEmailAddressErrorMessage is the error message to be displayed when an existing email is used to create a new organisation
	DuplicateOrganisationEmailAddressErrorMessage = "the provided email is associated with another organisation"
)

Variables

This section is empty.

Functions

func AssignRolesErr

func AssignRolesErr(err error) error

AssignRolesErr returns an error message when the user role assignment fails

func CheckUserPermissionErr

func CheckUserPermissionErr(err error) error

CheckUserPermissionErr returns an error message when the user permission check fails

func CheckUserRoleErr

func CheckUserRoleErr(err error) error

CheckUserRoleErr returns an error message when the user role check fails

func ClientCCCIdentifierNotFoundErr

func ClientCCCIdentifierNotFoundErr(err error) error

ClientCCCIdentifierNotFoundErr returns an error message when the client profile is not found

func ClientHasUnresolvedPinResetRequestErr

func ClientHasUnresolvedPinResetRequestErr() error

ClientHasUnresolvedPinResetRequestErr returns an error message when the client has an unresolved pin reset request

func ClientProfileNotFoundErr

func ClientProfileNotFoundErr(err error) error

ClientProfileNotFoundErr returns an error message when the client profile is not found

func ContactNotFoundErr

func ContactNotFoundErr(err error) error

ContactNotFoundErr returns an error message when the contact is not found

func CreateClientCaregiverErr

func CreateClientCaregiverErr(err error) error

CreateClientCaregiverErr returns an error message when the client caregiver creation fails

func CreateOrganisationErr

func CreateOrganisationErr(err error, message string, code int) error

CreateOrganisationErr returns an error message when the organisation creation fails

func CreateProgramErr

func CreateProgramErr(err error) error

CreateProgramErr returns an error message when a program is not saved successfully

func EmptyInputErr

func EmptyInputErr(err error) error

EmptyInputErr returns an error message when an input is empty

func EmptyUserIDErr

func EmptyUserIDErr(err error) error

EmptyUserIDErr returns an error message when the user id is empty

func EncryptionErr

func EncryptionErr(err error) error

EncryptionErr returns an error message when the 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 ExpiredPinErr

func ExpiredPinErr() error

ExpiredPinErr returns an error message when the pin is expired

func FailedSecurityCountExceededErr

func FailedSecurityCountExceededErr(err error) error

FailedSecurityCountExceededErr returns an error message when the user is not authorized to verify the security question response

func FailedToSaveItemErr

func FailedToSaveItemErr(err error) error

FailedToSaveItemErr returns an error message when the item save fails

func FailedToUpdateItemErr

func FailedToUpdateItemErr(err error) error

FailedToUpdateItemErr returns an error message when the item update fails

func GeneratePinErr

func GeneratePinErr(err error) error

GeneratePinErr returns an error message when the pin generation fails

func GenerateTempPINErr

func GenerateTempPINErr(err error) error

GenerateTempPINErr returns an error message when the temp pin generation fails

func GetAllRolesErr

func GetAllRolesErr(err error) error

GetAllRolesErr returns an error message when the user role retrieval fails

func GetError

func GetError(err error) error

GetError returns the error from custom error

func GetErrorCode

func GetErrorCode(err error) int

GetErrorCode returns the error code from custom error

func GetInviteLinkErr

func GetInviteLinkErr(err error) error

GetInviteLinkErr returns an error message when the invite link generation fails

func GetLoggedInUserUIDErr

func GetLoggedInUserUIDErr(err error) error

GetLoggedInUserUIDErr returns an error message when the logged in user uid check fails

func GetUserPermissionsErr

func GetUserPermissionsErr(err error) error

GetUserPermissionsErr returns an error message when the user permission retrieval fails

func GetUserRolesErr

func GetUserRolesErr(err error) error

GetUserRolesErr returns an error message when the user role retrieval fails

func InputValidationErr

func InputValidationErr(err error) error

InputValidationErr returns an error message when the input is invalid

func InternalErr

func InternalErr(err error) error

InternalErr returns an error message when the server fails

func InvalidContactTypeErr

func InvalidContactTypeErr(err error) error

InvalidContactTypeErr returns an error message when the contact type is invalid

func InvalidFlavourDefinedErr

func InvalidFlavourDefinedErr(err error) error

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

func InvalidResetPinPayloadErr

func InvalidResetPinPayloadErr(err error) error

InvalidResetPinPayloadErr returns an error message when the provided reset pin payload is invalid

func InvalidatePinErr

func InvalidatePinErr(err error) error

InvalidatePinErr returns an error message when the reset pin is invalid

func ItemNotFoundErr

func ItemNotFoundErr(err error) error

ItemNotFoundErr returns an error message when the item is not found

func LoginCountUpdateErr

func LoginCountUpdateErr(err error) error

LoginCountUpdateErr returns an error message when the login count update fails

func LoginTimeUpdateErr

func LoginTimeUpdateErr(err error) error

LoginTimeUpdateErr returns an error message when the login time update fails

func NexAllowedLoginTimeErr

func NexAllowedLoginTimeErr(err error) error

NexAllowedLoginTimeErr returns an error message when the login time update fails

func NoContactsErr

func NoContactsErr(err error) error

NoContactsErr returns an error message when there are no contacts

func NonExistentOrganizationErr

func NonExistentOrganizationErr(err error) error

NonExistentOrganizationErr returns an error if the organization does not exist

func NormalizeMSISDNError

func NormalizeMSISDNError(err error) error

NormalizeMSISDNError returns an error when normalizing the msisdn fails

func NotActiveErr

func NotActiveErr(err error) error

NotActiveErr returns an error message when a field is not active

func NotOptedInErr

func NotOptedInErr(err error) error

NotOptedInErr returns an error message when the user is not opted in

func OrgIDForProgramExistErr

func OrgIDForProgramExistErr(err error) error

OrgIDForProgramExistErr returns an error message when an organization id exist for a program that is being created

func PINErr

func PINErr(err error) error

PINErr returns an error message when the PIN is invalid

func PINExpiredErr

func PINExpiredErr(err error) error

PINExpiredErr returns an error message when the reset pin is invalid

func PinMismatchError

func PinMismatchError() 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 ProfileNotFoundErr

func ProfileNotFoundErr(err error) error

ProfileNotFoundErr returns an error message when the profile is not found

func ResetPinErr

func ResetPinErr(err error) error

ResetPinErr returns an error message when the reset pin is invalid

func RetryLoginErr

func RetryLoginErr(err error) error

RetryLoginErr returns an error message when the user is not authorized to perform the action

func RevokeRolesErr

func RevokeRolesErr(err error) error

RevokeRolesErr returns an error message when the user roles' revocation fails

func SaveUserPinError

func SaveUserPinError(err error) error

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

func SecurityQuestionNotFoundErr

func SecurityQuestionNotFoundErr(err error) error

SecurityQuestionNotFoundErr returns an error message when the security question is not found

func SecurityQuestionResponseMismatchErr

func SecurityQuestionResponseMismatchErr(err error) error

SecurityQuestionResponseMismatchErr returns an error message when the security question response does not match

func SendSMSErr

func SendSMSErr(err error) error

SendSMSErr returns an error message when the SMS sending fails

func StaffHasUnresolvedPinResetRequestErr

func StaffHasUnresolvedPinResetRequestErr() error

StaffHasUnresolvedPinResetRequestErr returns an error message when the staff has an unresolved pin reset request

func StaffProfileNotFoundErr

func StaffProfileNotFoundErr(err error) error

StaffProfileNotFoundErr returns an error message when the client profile is not found

func UpdateClientCaregiverErr

func UpdateClientCaregiverErr(err error) error

UpdateClientCaregiverErr returns an error message when client caregiver update fails

func UpdateProfileErr

func UpdateProfileErr(err error) error

UpdateProfileErr returns an error message when the user profile update fails

func UserNameExistsErr

func UserNameExistsErr(err error) error

UserNameExistsErr returns an error message when the item update fails

func UserNotAuthorizedErr

func UserNotAuthorizedErr(err error) error

UserNotAuthorizedErr returns an error message when the user is not authorized to perform the action

func UserNotFoundError

func UserNotFoundError(err error) error

UserNotFoundError returns an error message when a user is not found

func ValidatePINDigitsErr

func ValidatePINDigitsErr(err error) error

ValidatePINDigitsErr returns an error message when the pin digits are invalid

Types

type CustomError

type CustomError struct {
	Err     error  `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
	Code    int    `json:"code,omitempty"`
	Detail  string `json:"detail,omitempty"`
}

CustomError represents a custom error struct Reference https://blog.golang.org/error-handling-and-go

func (*CustomError) Error

func (e *CustomError) Error() string

type ErrorCode

type ErrorCode int

ErrorCode are used to determine the nature of an error, and why it occurred both the frontend and backend should be aware of these codes

const (
	// OK is returned on success.
	OK ErrorCode = iota + 1

	// Internal errors means some invariants expected by underlying
	// system has been broken. If you see one of these errors,
	// something is very broken.
	// it's value is 2
	Internal

	// UndefinedArguments errors means either one or more arguments to
	// a method have not been specified
	// it's value is 3
	UndefinedArguments

	// PhoneNumberInUse indicates that a phone number has an associated user profile.
	// this error can occur when fetching a user profile using a phone number, to check
	// that the phone number has not already been registered. The check usually runs
	// on both PRIMARY PHONE and SECONDARY PHONE
	// it's value is 4
	PhoneNumberInUse

	// EmailAddressInUse indicates that an email address has an associated user profile.
	// this error can occur when fetching a user profile using an email address, to check
	// that the email address has not already been registered. The check usually runs
	// on both PRIMARY EMAIL ADDRESS and SECONDARY EMAIL ADDRESS.
	// it's value is 5
	EmailAddressInUse

	// UsernameInUse indicates that a username has an associated user profile.
	// this error can occur when trying a update a user's username with a username that already has been taken
	// it's value is 6
	UsernameInUse

	// ProfileNotFound errors means a user profile does not exist with the provided parameters
	// This occurs when fetching a user profile either by UID, ID , PHONE NUMBER or EMAIL and no
	// matching record is found
	// it's value is 7
	ProfileNotFound

	// PINMismatch errors means that the provided PINS do not match (are not similar)
	// it's value is 8
	PINMismatch

	// PINNotFound errors means a user PIN does not exist with the provided parameters
	// This occurs when fetching a PIN by the user's user profile ID and no
	// matching record is found. This should never occur and if it does then it means
	// there is a serious issue with our data
	// it's value is 9
	PINNotFound

	// UserNotFound errors means that a user's firebase auth account does not exists. This occurs
	// when fetching a firebase user by either a phone number or an email and their record is not found
	// it's value is 10
	UserNotFound

	// ProfileSuspended error means that user's profile has been suspended.
	// This may occur due to violation of terms or detection of suspicious activity
	// It's value is 11
	ProfileSuspended

	// PINError error means that some actions could not be performed on the PIN.
	// This may occur when the provided PIN cannot be encrypted, cannot be validated and/or is of invalid length
	// It's value is 12
	PINError

	// InvalidPushTokenLength means that an invalid push token was given.
	// This may occur when the length of the issued token is of less then the minimum character(1250)
	// It's error code is 13
	InvalidPushTokenLength

	// InvalidEnum means that the provided enumerator was of invalid.
	// This may occur when an invalid enum value has been defined. For example, PartnerType, LoginProviderType e.t.c
	// It's error code is 14
	InvalidEnum

	// OTPVerificationFailed means that the provide OTP could not be verified
	// This may occur when an incorrect OTP is supplied
	// It's error code is 15
	OTPVerificationFailed

	// MissingInput means that no OTP was submitted
	// This may occur when a user fails to provide an OTP but makes a submission
	// It's error code id 16
	MissingInput

	// InvalidFlavour means that the provide flavour is invalid
	// This may happen when the provided flavour is not consumer or pro
	// It's error code is 17
	InvalidFlavour

	// RecordNotFound means that the provided record is not found.
	// This may happen when the provided data e.g currency, user etc is not accepted
	// It's error code is 18
	RecordNotFound

	// UnableToFindProvider means that the selected provider could not be found
	// This may happen if the provider is not specified in the charge master
	// It's error code is 19
	UnableToFindProvider

	// PublishNudgeFailure means that there was an error while publishing a nudge
	// It's error code is 20
	PublishNudgeFailure

	// InvalidCredentials means that the provided credentials are invalid
	// This may happen when any of the customers provides wrong credentials
	// It's error code is 21
	InvalidCredentials

	// AddNewRecordError means that the record could not be saved
	// This may happen may be as a result of wrong credentials or biodata
	// It's error code is 22
	AddNewRecordError

	// RoleNotValid means that the user role does not match the role required
	// to perform the current operation that the user is trying to perform.
	// Its error code is 23
	RoleNotValid

	//UserNotAuthorizedToAccessThisResource means that the subject's
	//email has been found to not have access to the specified resource
	//Its error code is 24
	UserNotAuthorizedToAccessThisResource

	//UnableToCheckIfUserIsAnAdmin means that
	//checking to see if a user is an admin has failed
	//Its error code is 25
	UnableToCheckIfUserIsAnAdmin

	//LoggedInUserIsNotAnAdmin means that
	//the user currently logged in has been found to not be an admin
	//Its error code is 26
	LoggedInUserIsNotAnAdmin

	// UnableToRetrieveNotification means that
	//retrieving a node from firestore fails with this ID
	//Its error code is 27
	UnableToRetrieveNotification

	//UnableToSaveNotification means that
	//saving a notification after updating it to read has failed
	//Its error code is 28
	UnableToSaveNotification

	//NoConfirmedPhoneNumbers means that
	//a user's primary phone number is  nil
	//Its error code is 29
	NoConfirmedPhoneNumbers

	//InvalidPhoneNumberFormat means that
	//the phone number format is invalid
	//Its error code is 30
	InvalidPhoneNumberFormat

	// UnableToSendText means that
	//sending a text to the phone number in question has failed
	//Its  error code is 31
	UnableToSendText

	//UnknownStateProvided means that
	//an unknown state has been entered
	//Its error code is 32
	UnknownStateProvided

	//NavigationActionsError means that
	//the system is not able to update or retrieve a users navigation actions
	//Its error code is 33
	NavigationActionsError

	// GetInviteLinkError means that the system is unable to get a user's invite link'
	// the flavour passed when generating the invite link is invalid
	// Its error code is 34
	GetInviteLinkError

	// SendInviteSMSError means that the system is unable to send an invite SMS' to a user'
	// the system failed to make a successful request to the messaging service
	// Its error code is 35
	SendInviteSMSError

	// GenerateTempPINError means that the system is unable to generate a temporary PIN'
	// the random number generator has failed (which is highly unlikely)
	// Its error code is 36
	GenerateTempPINError

	// InvalidResetPinPayloadError means that the system is unable to validate the reset pin input'
	// the user ID or the flavor are not provided
	// Its error code is 37
	InvalidResetPinPayloadError

	// EmptyUserIDInputError means that the system is unable to userID input'
	// the user ID is empty
	// Its error code is 38
	EmptyUserIDInputError

	// InvalidatePinError means that the system is unable to invalidate a reset pin'
	// the invalidation action has failed
	// Its error code is 39
	InvalidatePinError

	// ResetPinError means that the system is unable to reset a pin'
	// the reset action has failed
	// Its error code is 40
	ResetPinError

	// PINExpiredError means that the pin provided is expired'
	// the pin's expiration time' has passed
	// Its error code is 41
	PINExpiredError

	// EmptyInputError means that the system is unable to validate the input'
	// the input is empty
	// Its error code is 42
	EmptyInputError

	// NotOptedInError means that the system user has not opted in the input for a contact'
	// the user has not opted in for the input'
	// Its error code is 43
	NotOptedInError

	// NotActiveError means that the a field is not active'
	// the field is not active'
	// Its error code is 44
	NotActiveError

	// InvalidContactTypeError means that the system is unable to validate the contact type'
	// the contact type is invalid'
	// Its error code is 45
	InvalidContactTypeError

	// NoContactsError means that the system could not find any contacts'
	// the user has no contacts'
	// Its error code is 46
	NoContactsError

	// ContactNotFoundError means that the system could not find the contact'
	// the contact was not found'
	// Its error code is 47
	ContactNotFoundError

	// ExpiredPinError means that the system is unable to validate the pin'
	// The pin provided has expired'
	// Its error code is 48
	ExpiredPinError

	// LoginCountUpdateError means that the system is unable to update the login count'
	// The login count update has failed'
	// Its error code is 49
	LoginCountUpdateError

	// LoginTimeUpdateError means that the system is unable to update the login time'
	// The login time update has failed'
	// Its error code is 50
	LoginTimeUpdateError

	// NexAllowedLoginTimeError means that the system is unable to validate the login time'
	// The login time is not allowed'
	// Its error code is 51
	NexAllowedLoginTimeError

	// SendSMSError means that the system is unable to send an SMS'
	// The SMS sending has failed'
	// Its error code is 52
	SendSMSError

	// FailedToUpdateItemError means that the system is unable to update an item'
	// The update has failed'
	// Its error code is 53
	FailedToUpdateItemError

	// ItemNotFoundError means that the system is unable to find an item'
	// The item was not found'
	// Its error code is 54
	ItemNotFoundError

	// InputValidationError means that the system is unable to validate the input'
	// The input is invalid'
	// Its error code is 55
	InputValidationError

	// EncryptionError means that the system is unable to encrypt the input'
	// The encryption has failed'
	// Its error code is 56
	EncryptionError

	// FailedToSaveItemError means that the system is unable to save an item'
	// The save has failed'
	// Its error code is 57
	FailedToSaveItemError

	// GeneratePinError means that the system is unable to generate a pin'
	// The pin generation has failed'
	// Its error code is 58
	GeneratePinError

	// ValidatePINDigitsError means that the system is unable to validate the pin'
	// The pin is invalid'
	// Its error code is 59
	ValidatePINDigitsError

	// GetFAQContentError means that the system is unable to get the FAQ content'
	// The FAQ content retrieval has failed'
	// Its error code is 60
	GetFAQContentError

	// UpdateClientCaregiverError means that the system is unable to update the client caregiver'
	// The update has failed'
	// Its error code is 61
	UpdateClientCaregiverError

	// CreateClientCaregiverError means that the system is unable to create the client caregiver'
	// The creation has failed'
	// Its error code is 62
	CreateClientCaregiverError

	// GetLoggedInUserUIDError means that the system is unable to get the logged in user UID'
	// The retrieval has failed'
	// Its error code is 63
	GetLoggedInUserUIDError

	// CheckUserRoleError means that the system is unable to check the user role'
	// The check has failed'
	// Its error code is 64
	CheckUserRoleError

	// UserNotAuthorizedError means that the system is unable to validate the user'
	// The user is not authorized'
	// Its error code is 65
	UserNotAuthorizedError

	// CheckUserPermissionError means that the system is unable to check the user permission'
	// The check has failed'
	// Its error code is 66
	CheckUserPermissionError
	// AssignRolesError means that the system is unable to assign roles'
	// The assignment has failed'
	// Its error code is 67
	AssignRolesError

	// GetUserRolesError means that the system is unable to get the user roles'
	// The retrieval has failed'
	// Its error code is 68
	GetUserRolesError

	// GetUserPermissionsError means that the system is unable to get the user permissions'
	// The retrieval has failed'
	// Its error code is 69
	GetUserPermissionsError
	// RevokeRolesError means that the system is unable to revoke roles
	// The revocation has failed'
	// Its error code is 70
	RevokeRolesError

	// NickNameExistsError implies that the set nickname has already been taken
	// Its error code is 71
	NickNameExistsError

	// ClientHasUnresolvedPinResetRequestError implies that the client has an unresolved pin reset request
	// Its error code is 72
	ClientHasUnresolvedPinResetRequestError

	// RetryLoginError implies that the system is unable to retry the login
	// Its error code is 73
	RetryLoginError

	// GetAllRolesError implies that the system is unable to get all roles
	// Its error code is 74
	GetAllRolesError

	// InactiveUser is returned when a user profile is not active. If they are inactive
	// it mens they opted out and they should not be able to access the platform
	// Its error code is 75
	InactiveUser

	// RecordNotFoundError implies that the system is unable to find the record
	// Its error code is 76
	RecordNotFoundError

	// FailedSecurityCountExceededError implies that the user is unable to verify security questions because the number of failed verification attempts has been exceeded
	// Its error code is 77
	FailedSecurityCountExceededError

	// SecurityQuestionResponseMismatchError implies that the user is unable to verify security questions because the response does not match the one in the database
	// Its error code is 78
	SecurityQuestionResponseMismatchError

	// SecurityQuestionNotFoundError implies that the user is unable to verify security questions because the question was not found
	// Its error code is 79
	SecurityQuestionNotFoundError

	// UpdateProfileError implies that the system is unable to update the profile
	// Its error code is 80
	UpdateProfileError

	// CCCIdentifierNotFoundError implies that the clients identifier was not found
	// Its error code is 81
	CCCIdentifierNotFoundError

	// StaffHasUnresolvedPinResetRequestError implies that the staff has an unresolved pin reset request
	// Its error code is 82
	StaffHasUnresolvedPinResetRequestError

	// NonExistentOrganizationError indicates that the organization is not present in the database
	// it is error code 83
	NonExistentOrganizationError

	// OrgIDForProgramExistError indicates that another program is already associated with the organization
	// it is error code 84
	OrgIDForProgramExistError

	// CreateProgramError means that the system is unable to create a new program
	// it is error code 85
	CreateProgramError

	// FailToCreateOrganisation is the error code for use when the system is unable to create an organisation
	FailToCreateOrganisation

	// DuplicateOrganisationCode is the error code to be returned when their is a duplicate organisation.
	DuplicateOrganisationCode

	// DuplicateOrganisationName is the error code to be returned when an organisation is registered with an existing 'organisation name'
	DuplicateOrganisationName

	// DuplicateOrganisationPhoneNumber is the error code to be returned when organisation is registered with an existing phone number
	DuplicateOrganisationPhoneNumber

	// DuplicateOrganisationEmailAddress is the error code to be used when organisation is registered with an existing organisation email address
	DuplicateOrganisationEmailAddress
)

func (ErrorCode) Code

func (e ErrorCode) Code() int

Code int value for an error code

Jump to

Keyboard shortcuts

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