merr

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClientError_name = map[int32]string{
		0: "BAD_REQUEST",
		1: "NOT_FOUND",
		2: "CAPTCHA",
		3: "PARAMS",
		4: "EXIST",
		5: "REQUIRED",
		6: "CONFLICT",
	}
	ClientError_value = map[string]int32{
		"BAD_REQUEST": 0,
		"NOT_FOUND":   1,
		"CAPTCHA":     2,
		"PARAMS":      3,
		"EXIST":       4,
		"REQUIRED":    5,
		"CONFLICT":    6,
	}
)

Enum value maps for ClientError.

View Source
var (
	UnauthorizedError_name = map[int32]string{
		0: "UNAUTHORIZED",
		1: "TOKEN_INVALID",
		2: "TOKEN_EXPIRED",
		3: "USER_FORBIDDEN",
		4: "USER_NOT_FOUND",
	}
	UnauthorizedError_value = map[string]int32{
		"UNAUTHORIZED":   0,
		"TOKEN_INVALID":  1,
		"TOKEN_EXPIRED":  2,
		"USER_FORBIDDEN": 3,
		"USER_NOT_FOUND": 4,
	}
)

Enum value maps for UnauthorizedError.

View Source
var (
	ForbiddenError_name = map[int32]string{
		0: "FORBIDDEN",
		1: "RESOURCE_NOT_OPEN",
		4: "PASSWORD",
		5: "PERMISSION_DENIED",
	}
	ForbiddenError_value = map[string]int32{
		"FORBIDDEN":         0,
		"RESOURCE_NOT_OPEN": 1,
		"PASSWORD":          4,
		"PERMISSION_DENIED": 5,
	}
)

Enum value maps for ForbiddenError.

View Source
var (
	ServerError_name = map[int32]string{
		0: "INTERNAL_SERVER",
		1: "INVALID_ARGUMENT",
	}
	ServerError_value = map[string]int32{
		"INTERNAL_SERVER":  0,
		"INVALID_ARGUMENT": 1,
	}
)

Enum value maps for ServerError.

Functions

func ErrorBadRequest

func ErrorBadRequest(format string, args ...interface{}) *errors.Error

BAD_REQUEST Request Parameter Issues

  • Incorrect Request Format: The data format sent by the client does not meet the requirements of the API.
  • Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
  • Missing Necessary Parameters: The required parameters for the API are not provided.
  • Invalid Parameter Format: The provided parameter format is incorrect.

func ErrorCaptcha

func ErrorCaptcha(format string, args ...interface{}) *errors.Error

CAPTCHA Captcha Verification Failed

  • Incorrect Captcha: The provided captcha code is incorrect.
  • Captcha Expired: The captcha code has expired and cannot be used.
  • Captcha Not Provided: The captcha code is required but not provided.

func ErrorConflict

func ErrorConflict(format string, args ...interface{}) *errors.Error

CONFLICT Conflict

  • The requested resource already exists.
  • The requested resource already error.

func ErrorExist

func ErrorExist(format string, args ...interface{}) *errors.Error

EXIST Resource Already Exists

  • The requested resource already exists.
  • The requested resource already error

func ErrorForbidden

func ErrorForbidden(format string, args ...interface{}) *errors.Error

## Permission Denied - The user does not have the necessary permissions to access the resource.

func ErrorInternalServer

func ErrorInternalServer(format string, args ...interface{}) *errors.Error

## Server Error - The server encountered an unexpected error. - The server is temporarily unavailable.

func ErrorInvalidArgument

func ErrorInvalidArgument(format string, args ...interface{}) *errors.Error

## Invalid Argument - The provided argument is invalid or does not meet the requirements. - The provided argument is out of range. - The provided argument is not supported.

func ErrorNotFound

func ErrorNotFound(format string, args ...interface{}) *errors.Error

NOT_FOUND Resource Not Found

  • The requested resource does not exist or is not available.

func ErrorParams

func ErrorParams(format string, args ...interface{}) *errors.Error

PARAMS Invalid Parameters

  • Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
  • Missing Necessary Parameters: The required parameters for the API are not provided.

func ErrorPassword

func ErrorPassword(format string, args ...interface{}) *errors.Error

## Invalid Password - The provided password is invalid. - The user account is disabled and cannot access the resource.

func ErrorPermissionDenied

func ErrorPermissionDenied(format string, args ...interface{}) *errors.Error

## Permission Denied - The user does not have the necessary permissions to access the resource. - The member account is disabled and cannot access the resource.

func ErrorRequired

func ErrorRequired(format string, args ...interface{}) *errors.Error

REQUIRED Required

  • The requested parameter is required.

func ErrorResourceNotOpen

func ErrorResourceNotOpen(format string, args ...interface{}) *errors.Error

## Resource Not Open - The requested resource is not open to the public.

func ErrorTokenExpired

func ErrorTokenExpired(format string, args ...interface{}) *errors.Error

TOKEN_EXPIRED Token Expired

  • The provided authentication token has expired.

func ErrorTokenInvalid

func ErrorTokenInvalid(format string, args ...interface{}) *errors.Error

UNAUTHORIZED_INVALID_TOKEN Invalid Token

  • The provided authentication token is invalid or does not have the required permissions.

func ErrorUnauthorized

func ErrorUnauthorized(format string, args ...interface{}) *errors.Error

UNAUTHORIZED Authentication Issues - The user is not authenticated or does not have the required permissions to access the resource.

func ErrorUserForbidden

func ErrorUserForbidden(format string, args ...interface{}) *errors.Error

USER_FORBIDDEN User Forbidden

  • The user account is disabled and cannot access the resource.

func ErrorUserNotFound

func ErrorUserNotFound(format string, args ...interface{}) *errors.Error

USER_NOT_FOUND User Not Found

  • The requested user does not exist.

func IsBadRequest

func IsBadRequest(err error) bool

BAD_REQUEST Request Parameter Issues

  • Incorrect Request Format: The data format sent by the client does not meet the requirements of the API.
  • Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
  • Missing Necessary Parameters: The required parameters for the API are not provided.
  • Invalid Parameter Format: The provided parameter format is incorrect.

func IsCaptcha

func IsCaptcha(err error) bool

CAPTCHA Captcha Verification Failed

  • Incorrect Captcha: The provided captcha code is incorrect.
  • Captcha Expired: The captcha code has expired and cannot be used.
  • Captcha Not Provided: The captcha code is required but not provided.

func IsConflict

func IsConflict(err error) bool

CONFLICT Conflict

  • The requested resource already exists.
  • The requested resource already error.

func IsExist

func IsExist(err error) bool

EXIST Resource Already Exists

  • The requested resource already exists.
  • The requested resource already error

func IsForbidden

func IsForbidden(err error) bool

## Permission Denied - The user does not have the necessary permissions to access the resource.

func IsInternalServer

func IsInternalServer(err error) bool

## Server Error - The server encountered an unexpected error. - The server is temporarily unavailable.

func IsInvalidArgument

func IsInvalidArgument(err error) bool

## Invalid Argument - The provided argument is invalid or does not meet the requirements. - The provided argument is out of range. - The provided argument is not supported.

func IsNotFound

func IsNotFound(err error) bool

NOT_FOUND Resource Not Found

  • The requested resource does not exist or is not available.

func IsParams

func IsParams(err error) bool

PARAMS Invalid Parameters

  • Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
  • Missing Necessary Parameters: The required parameters for the API are not provided.

func IsPassword

func IsPassword(err error) bool

## Invalid Password - The provided password is invalid. - The user account is disabled and cannot access the resource.

func IsPermissionDenied

func IsPermissionDenied(err error) bool

## Permission Denied - The user does not have the necessary permissions to access the resource. - The member account is disabled and cannot access the resource.

func IsRequired

func IsRequired(err error) bool

REQUIRED Required

  • The requested parameter is required.

func IsResourceNotOpen

func IsResourceNotOpen(err error) bool

## Resource Not Open - The requested resource is not open to the public.

func IsTokenExpired

func IsTokenExpired(err error) bool

TOKEN_EXPIRED Token Expired

  • The provided authentication token has expired.

func IsTokenInvalid

func IsTokenInvalid(err error) bool

UNAUTHORIZED_INVALID_TOKEN Invalid Token

  • The provided authentication token is invalid or does not have the required permissions.

func IsUnauthorized

func IsUnauthorized(err error) bool

UNAUTHORIZED Authentication Issues - The user is not authenticated or does not have the required permissions to access the resource.

func IsUserForbidden

func IsUserForbidden(err error) bool

USER_FORBIDDEN User Forbidden

  • The user account is disabled and cannot access the resource.

func IsUserNotFound

func IsUserNotFound(err error) bool

USER_NOT_FOUND User Not Found

  • The requested user does not exist.

Types

type ClientError

type ClientError int32
const (
	// BAD_REQUEST Request Parameter Issues
	//   - Incorrect Request Format: The data format sent by the client does not meet the requirements of the API.
	//   - Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
	//   - Missing Necessary Parameters: The required parameters for the API are not provided.
	//   - Invalid Parameter Format: The provided parameter format is incorrect.
	ClientError_BAD_REQUEST ClientError = 0
	// NOT_FOUND Resource Not Found
	//   - The requested resource does not exist or is not available.
	ClientError_NOT_FOUND ClientError = 1
	// CAPTCHA Captcha Verification Failed
	//   - Incorrect Captcha: The provided captcha code is incorrect.
	//   - Captcha Expired: The captcha code has expired and cannot be used.
	//   - Captcha Not Provided: The captcha code is required but not provided.
	ClientError_CAPTCHA ClientError = 2
	// PARAMS Invalid Parameters
	//   - Invalid Parameter Values: The provided parameter values do not comply with business rules or format requirements.
	//   - Missing Necessary Parameters: The required parameters for the API are not provided.
	ClientError_PARAMS ClientError = 3
	// EXIST Resource Already Exists
	//   - The requested resource already exists.
	//   - The requested resource already error
	ClientError_EXIST ClientError = 4
	// REQUIRED Required
	//   - The requested parameter is required.
	ClientError_REQUIRED ClientError = 5
	// CONFLICT Conflict
	//   - The requested resource already exists.
	//   - The requested resource already error.
	ClientError_CONFLICT ClientError = 6
)

func (ClientError) Descriptor

func (ClientError) Enum

func (x ClientError) Enum() *ClientError

func (ClientError) EnumDescriptor deprecated

func (ClientError) EnumDescriptor() ([]byte, []int)

Deprecated: Use ClientError.Descriptor instead.

func (ClientError) Number

func (x ClientError) Number() protoreflect.EnumNumber

func (ClientError) String

func (x ClientError) String() string

func (ClientError) Type

type ForbiddenError

type ForbiddenError int32
const (
	// ## Permission Denied
	// - The user does not have the necessary permissions to access the resource.
	ForbiddenError_FORBIDDEN ForbiddenError = 0
	// ## Resource Not Open
	// - The requested resource is not open to the public.
	ForbiddenError_RESOURCE_NOT_OPEN ForbiddenError = 1
	// ## Invalid Password
	// - The provided password is invalid.
	// - The user account is disabled and cannot access the resource.
	ForbiddenError_PASSWORD ForbiddenError = 4
	// ## Permission Denied
	// - The user does not have the necessary permissions to access the resource.
	// - The member account is disabled and cannot access the resource.
	ForbiddenError_PERMISSION_DENIED ForbiddenError = 5
)

func (ForbiddenError) Descriptor

func (ForbiddenError) Enum

func (x ForbiddenError) Enum() *ForbiddenError

func (ForbiddenError) EnumDescriptor deprecated

func (ForbiddenError) EnumDescriptor() ([]byte, []int)

Deprecated: Use ForbiddenError.Descriptor instead.

func (ForbiddenError) Number

func (ForbiddenError) String

func (x ForbiddenError) String() string

func (ForbiddenError) Type

type ServerError

type ServerError int32
const (
	// ## Server Error
	// - The server encountered an unexpected error.
	// - The server is temporarily unavailable.
	ServerError_INTERNAL_SERVER ServerError = 0
	// ## Invalid Argument
	// - The provided argument is invalid or does not meet the requirements.
	// - The provided argument is out of range.
	// - The provided argument is not supported.
	ServerError_INVALID_ARGUMENT ServerError = 1
)

func (ServerError) Descriptor

func (ServerError) Enum

func (x ServerError) Enum() *ServerError

func (ServerError) EnumDescriptor deprecated

func (ServerError) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServerError.Descriptor instead.

func (ServerError) Number

func (x ServerError) Number() protoreflect.EnumNumber

func (ServerError) String

func (x ServerError) String() string

func (ServerError) Type

type UnauthorizedError

type UnauthorizedError int32
const (
	// UNAUTHORIZED Authentication Issues
	// - The user is not authenticated or does not have the required permissions to access the resource.
	UnauthorizedError_UNAUTHORIZED UnauthorizedError = 0
	// UNAUTHORIZED_INVALID_TOKEN Invalid Token
	//   - The provided authentication token is invalid or does not have the required permissions.
	UnauthorizedError_TOKEN_INVALID UnauthorizedError = 1
	// TOKEN_EXPIRED Token Expired
	//   - The provided authentication token has expired.
	UnauthorizedError_TOKEN_EXPIRED UnauthorizedError = 2
	// USER_FORBIDDEN User Forbidden
	//   - The user account is disabled and cannot access the resource.
	UnauthorizedError_USER_FORBIDDEN UnauthorizedError = 3
	// USER_NOT_FOUND User Not Found
	//   - The requested user does not exist.
	UnauthorizedError_USER_NOT_FOUND UnauthorizedError = 4
)

func (UnauthorizedError) Descriptor

func (UnauthorizedError) Enum

func (UnauthorizedError) EnumDescriptor deprecated

func (UnauthorizedError) EnumDescriptor() ([]byte, []int)

Deprecated: Use UnauthorizedError.Descriptor instead.

func (UnauthorizedError) Number

func (UnauthorizedError) String

func (x UnauthorizedError) String() string

func (UnauthorizedError) Type

Jump to

Keyboard shortcuts

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