allerror

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package allerror provides a set of error codes and error types used in the application.

Index

Constants

View Source
const (
	// ErrorCodeComputilityAccountFindError find computility account error
	ErrorCodeComputilityAccountFindError = "computility_account_find_error"

	// ErrorCodeComputilityOrgFindError find computility org error
	ErrorCodeComputilityOrgFindError = "computility_org_find_error"

	// ErrorCodeComputilityOrgUpdateError update computility org error
	ErrorCodeComputilityOrgUpdateError = "computility_org_update_error"

	// ErrorComputilityOrgQuotaLowerBoundError quota count lower bound error
	ErrorComputilityOrgQuotaLowerBoundError = "computility_org_quota_lower_bound_error"

	// ErrorComputilityOrgQuotaMultipleError quota count not a multiple of default quota
	ErrorComputilityOrgQuotaMultipleError = "computility_org_quota_multiple_error"

	// ErrorCodeInsufficientQuota user has insufficient quota balance
	ErrorCodeInsufficientQuota = "insufficient_quota"

	// ErrorCodeNoNpuPermission user has no npu permission
	ErrorCodeNoNpuPermission = "no_npu_permission"

	// ErrorCodeAccessTokenInvalid This error code is for restful api
	ErrorCodeAccessTokenInvalid = "access_token_invalid"

	// ErrorCodeSpaceAppUnmatchedStatus is const
	ErrorCodeSpaceAppUnmatchedStatus = "space_app_unmatched_status"

	// ErrorCodeSpaceAppNotFound space app
	ErrorCodeSpaceAppNotFound = "space_app_not_found"

	// ErrorCodeSpaceNotFound is const
	ErrorCodeSpaceNotFound = "space_not_found"

	// ErrorCodeSpaceCommitConflict is const
	ErrorCodeSpaceCommitConflict = "space_commit_conflict"

	// ErrorCodeSpaceAppCreateFailed
	ErrorCodeSpaceAppCreateFailed = "space_app_create_failed"

	// ErrorCodeUserNotFound
	ErrorCodeUserNotFound = "user_not_found"

	// ErrorCodeRevokePrivacyFailed
	ErrorCodeRevokePrivacyFailed = "revoke_privacy_failed"

	// ErrorCodeRevokeAgreementFailed
	ErrorCodeRevokeAgreementFailed = "revoke_agreement_failed"

	// ErrorCodeFailToModerate
	ErrorCodeCallAuditFailed = "call_audit_failed"

	// ErrorCodeModerateUnpass
	ErrorCodeAuditBlock = "audit_block"
)

Variables

This section is empty.

Functions

func InnerErr

func InnerErr(err error) error

InnerErr returns the inner error.

func IsNotFound

func IsNotFound(err error) (notfoudError, bool)

IsNotFound checks if the given error is a not found error.

func New

func New(code string, msg string, err error) errorImpl

New creates a new error with the specified code and message.

This function creates a new errorImpl struct with the specified code, message and error info for diagnostic. If the message is empty, the function will replace all "_" in the code with " " as the message.

Parameters:

code: a string representing the type of the error
msg: a string representing the error message, which is returned to client or end user
err: error info for diagnostic, which is used for diagnostic by developers

Returns an errorImpl struct.

func NewNotFound

func NewNotFound(code string, msg string, err error) notfoudError

NewNotFound creates a new not found error with the specified code and message.

Types

type InnerError

type InnerError interface {
	InnerError() error
}

InnerError returns the inner error.

Jump to

Keyboard shortcuts

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