errors

package
v0.4.0-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ParamErrorCode          = "c"
	ParamErrorMessageFormat = "m"
)

parameters

Variables

View Source
var (
	FuncRegisterError         = coreutil.Func("registerError")
	ViewGetErrorMessageFormat = coreutil.ViewFunc("getErrorMessageFormat")
)
View Source
var Contract = coreutil.NewContract(coreutil.CoreContractErrors, "Errors contract")
View Source
var Processor = Contract.Processor(initialize,
	FuncRegisterError.WithHandler(funcRegisterError),
	ViewGetErrorMessageFormat.WithHandler(funcGetErrorMessageFormat),
)

Functions

func GetMessageFormat

func GetMessageFormat(code isc.VMErrorCode, callView ViewCaller) (string, error)

func NewStateErrorCollectionReader

func NewStateErrorCollectionReader(partition kv.KVStoreReader, hname isc.Hname) coreerrors.ErrorCollection

func NewStateErrorCollectionWriter

func NewStateErrorCollectionWriter(partition kv.KVStore, hname isc.Hname) coreerrors.ErrorCollection

func Resolve

func Resolve(e *isc.UnresolvedVMError, callView ViewCaller) (*isc.VMError, error)

func ResolveFromState

func ResolveFromState(state kv.KVStoreReader, e *isc.UnresolvedVMError) (*isc.VMError, error)

Types

type StateErrorCollectionReader

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

StateErrorCollectionReader implements ErrorCollection partially. Is used for contract internal error readings only. It requires a reference to a KVStoreReader such as the vmctx and the hname of the caller.

func (*StateErrorCollectionReader) Get

func (*StateErrorCollectionReader) Register

func (e *StateErrorCollectionReader) Register(messageFormat string) (*isc.VMErrorTemplate, error)

type StateErrorCollectionWriter

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

StateErrorCollectionWriter implements ErrorCollection. Is used for contract internal errors. It requires a reference to a KVStore such as the vmctx and the hname of the caller.

func (*StateErrorCollectionWriter) Get

func (*StateErrorCollectionWriter) Register

func (e *StateErrorCollectionWriter) Register(messageFormat string) (*isc.VMErrorTemplate, error)

type ViewCaller

type ViewCaller func(contractName string, funcName string, params dict.Dict) (dict.Dict, error)

ViewCaller is a generic interface for any function that can call views

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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