gfsperrors

package
v0.2.3-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCodeSpace defines the default code space for not predefined error.
	DefaultCodeSpace = "GfSp"
	// DefaultInnerCode defines the default inner code for not predefined error.
	DefaultInnerCode = 999999
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GfSpErrorManager

type GfSpErrorManager struct {
	// contains filtered or unexported fields
}

GfSpErrorManager manages the predefined GfSpError, the GfSpError uses as the standard error format inside the SP system, it includes the CodeSpace, HttpStatusCode, InnerCode and Description fields. The HttpStatusCode uses to fill the http response header, the InnerCode and Description uses to fill the http response body if the request is failed, the CodeSpace and InnerCode uses to help developer tp quickly pinpoint the cause and location of errors.

The InnerCode detailed specifications can be found at:

"github.com/bnb-chain/greenfield-storage-provider/base/errors.md"

func (*GfSpErrorManager) AddErr

func (g *GfSpErrorManager) AddErr(err *GfSpError)

AddErr add an error to the manager, predefined errors need to ensure the uniqueness of inner error codes.

Jump to

Keyboard shortcuts

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