centerrors

package
v0.0.2-alpha3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequiredField error when required field is empty
	// Deprecated: in favour of error types in each package
	RequiredField = "Required field"

	// NilDocument error when document passed is Nil
	// Deprecated: in favour of error types in each package
	NilDocument = "Nil document"

	// IdentifierReUsed error when same identifier is re-used
	// Deprecated: in favour of error types in each package
	IdentifierReUsed = "Identifier re-used"

	// NilDocumentData error when document data is Nil
	// Deprecated: in favour of error types in each package
	NilDocumentData = "Nil document data"

	// RequirePositiveNumber error when amount or any such is zero or negative
	// Deprecated: in favour of error types in each package
	RequirePositiveNumber = "Require positive number"
)

Variables

This section is empty.

Functions

func New

func New(code code.Code, message string) error

New constructs a new error with code and error message

func NewWithErrors

func NewWithErrors(c code.Code, message string, errs map[string]string) error

NewWithErrors constructs a new error with code, error message, and errors

func NilError

func NilError(param interface{}) error

NilError returns error with Type added to message Deprecated: in favour of functions in `github.com/centrifuge/go-centrifuge/errors`

func Wrap

func Wrap(err error, msg string) error

Wrap appends msg to errpb.Message if it is of type *errpb else appends the msg to error through fmt.Errorf Deprecated: this is intended for use within p2p or api handlers only, For services and internal errors use the Error type defined in `github.com/centrifuge/go-centrifuge/errors`

Types

type P2PError

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

P2PError represents p2p error type

func FromError

func FromError(err error) (*P2PError, bool)

FromError constructs and returns errorspb.Error if bool true, conversion to P2PError successful else failed and returns unknown P2PError

func (*P2PError) Code

func (p2pErr *P2PError) Code() code.Code

Code returns the error code

func (*P2PError) Errors

func (p2pErr *P2PError) Errors() map[string]string

Errors returns map errors passed

func (*P2PError) Message

func (p2pErr *P2PError) Message() string

Message returns error message

Jump to

Keyboard shortcuts

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