Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AnypbNew = anypb.New
Functions ¶
func ConvertToGrpcError ¶
func ConvertToGrpcError(serviceErr *ServiceError) error
func ExtractFromGrpcError ¶
Types ¶
type Error ¶
type Error interface { GetErrorMessage() ErrorMessage GetAttributes() map[string]interface{} Error() string }
type ErrorMessage ¶
type ErrorMessage string
var ( // General ServerError ErrorMessage = "errors.serverError" PermissionDenied ErrorMessage = "errors.permissionDenied" RecordNotFound ErrorMessage = "errors.recordNotFound" IsNotDeletable ErrorMessage = "errors.isNotDeletable" NoRowsEffected ErrorMessage = "errors.noRowsEffected" FailedSendEmail ErrorMessage = "errors.failedSendEmail" // User UserIsBanned ErrorMessage = "errors.userIsBanned" UserInActive ErrorMessage = "errors.userInActive" UserUnVerified ErrorMessage = "errors.userUnVerified" EmailRegistered ErrorMessage = "errors.emailRegistered" CredentialInvalid ErrorMessage = "errors.credentialInvalid" UserLogout ErrorMessage = "errors.userLogout" PasswordIsNull ErrorMessage = "errors.passwordIsNull" // OTP InvalidOTP ErrorMessage = "errors.invalidOTP" OTPExpired ErrorMessage = "errors.OTPExpired" // Token InvalidToken ErrorMessage = "errors.invalidToken" TokenExpired ErrorMessage = "errors.tokenExpired" // Validation InvalidRequestBody ErrorMessage = "errors.invalidRequestBody" // Role RoleExisted ErrorMessage = "errors.roleExisted" // TOTP InvalidTOTPCode ErrorMessage = "errors.invalidTOTPCode" TOTPNotEnrolled ErrorMessage = "errors.totpNotEnrolled" )
type ServiceError ¶
type ServiceError struct {
// contains filtered or unexported fields
}
func New ¶
func New(msg ErrorMessage, attrs ...map[string]interface{}) *ServiceError
func NewServerError ¶
func NewServerError() *ServiceError
func (ServiceError) Error ¶
func (r ServiceError) Error() string
func (ServiceError) GetAttributes ¶
func (r ServiceError) GetAttributes() map[string]interface{}
func (ServiceError) GetErrorMessage ¶
func (r ServiceError) GetErrorMessage() ErrorMessage
Click to show internal directories.
Click to hide internal directories.