errors

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ReasonInternalError = "InternalError"

ReasonInternalError 内部错误

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status interface {
	error
	// Reason 返回错误原因
	// 一个大驼峰格式可枚举的值
	Reason() string
	// Code 返回错误码
	// 可选, 0 表示无错误码
	Code() uint32
	// Message 返回人类可读的错误描述
	Message() string
}

Status 执行某些过程的异常结果(错误)

func FromError

func FromError(err error) Status

FromError 从 err 获取 Status

func New

func New(reason, message string) Status

New 创建一个 Status

func NewWithCode

func NewWithCode(code uint32, reason, message string) Status

NewWithCode 创建一个带错误码的 Status

Jump to

Keyboard shortcuts

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