ecode

package
v0.0.0-...-e90a31b Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 2 Imported by: 0

README

业务错误码定义

公共错误码已经在 github.com/go-eagle/eagle/pkg/errcode 包中,可以直接使用

业务的错误码可以根据模块按文件进行定义

使用时公共错误码 以 errno.开头,业务错误码以 ecode.开头

Demo

// 公共错误码
import "github.com/go-eagle/eagle/pkg/errcode"
...
errno.InternalServerError

// 业务错误码
import "github.com/go-eagle/eagle/internal/ecode"
...
ecode.ErrUserNotFound

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// common errors
	ErrInvalidArgument = errcode.New(codes.InvalidArgument, "Invalid argument")
	ErrInternalError   = errcode.New(codes.Internal, "Internal error")
	ErrAccessDenied    = errcode.New(codes.PermissionDenied, "Access denied")
	ErrNotFound        = errcode.New(codes.NotFound, "Not found")

	// relation grpc errors
	ErrUserIsExist = errcode.New(20100, "The user already exists.")
)

nolint: golint

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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