Documentation ¶
Index ¶
- func As(err error, target interface{}) bool
- func DisableLocationTracking()
- func EnableLocationTracking()
- func Is(err, target error) bool
- func Unwrap(err error) error
- func Wrap(code Status, err error) errordeprecated
- type CallSite
- func (v *CallSite) Copy() *CallSite
- func (v *CallSite) CopyAsInterface() interface{}
- func (v *CallSite) Equal(u *CallSite) bool
- func (v *CallSite) IsValid() error
- func (v *CallSite) MarshalBinary() ([]byte, error)
- func (v *CallSite) MarshalJSON() ([]byte, error)
- func (v *CallSite) UnmarshalBinary(data []byte) error
- func (v *CallSite) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *CallSite) UnmarshalJSON(b []byte) error
- type Error
- func (e *Error) CodeID() uint64
- func (v *Error) Copy() *Error
- func (v *Error) CopyAsInterface() interface{}
- func (v *Error) Equal(u *Error) bool
- func (e *Error) Error() string
- func (e *Error) Format(f fmt.State, verb rune)
- func (e *Error) Is(target error) bool
- func (v *Error) IsValid() error
- func (v *Error) MarshalBinary() ([]byte, error)
- func (v *Error) MarshalJSON() ([]byte, error)
- func (e *Error) Print() string
- func (e *Error) PrintFullCallstack() string
- func (v *Error) UnmarshalBinary(data []byte) error
- func (v *Error) UnmarshalBinaryFrom(rd io.Reader) error
- func (v *Error) UnmarshalJSON(b []byte) error
- func (e *Error) Unwrap() error
- type Skip
- type Status
- func (s Status) Error() string
- func (v Status) GetEnumValue() uint64
- func (s Status) IsClientError() bool
- func (s Status) IsKnownError() bool
- func (s Status) IsServerError() bool
- func (v Status) MarshalJSON() ([]byte, error)
- func (v *Status) SetEnumValue(id uint64) bool
- func (s Status) Skip(n int) Skip
- func (v Status) String() string
- func (s Status) Success() bool
- func (v *Status) UnmarshalJSON(data []byte) error
- func (s Status) With(v ...interface{}) *Error
- func (s Status) WithCauseAndFormat(cause error, format string, args ...interface{}) *Error
- func (s Status) WithFormat(format string, args ...interface{}) *Error
- func (s Status) Wrap(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLocationTracking ¶
func DisableLocationTracking()
func EnableLocationTracking ¶
func EnableLocationTracking()
Types ¶
type CallSite ¶
type CallSite struct { FuncName string `json:"funcName,omitempty" form:"funcName" query:"funcName" validate:"required"` File string `json:"file,omitempty" form:"file" query:"file" validate:"required"` Line int64 `json:"line,omitempty" form:"line" query:"line" validate:"required"` // contains filtered or unexported fields }
func (*CallSite) CopyAsInterface ¶
func (v *CallSite) CopyAsInterface() interface{}
func (*CallSite) MarshalBinary ¶
func (*CallSite) MarshalJSON ¶ added in v1.1.0
func (*CallSite) UnmarshalBinary ¶
func (*CallSite) UnmarshalJSON ¶ added in v1.1.0
type Error ¶
type Error struct { Message string `json:"message,omitempty" form:"message" query:"message" validate:"required"` Code Status `json:"code,omitempty" form:"code" query:"code" validate:"required"` Cause *Error `json:"cause,omitempty" form:"cause" query:"cause" validate:"required"` CallStack []*CallSite `json:"callStack,omitempty" form:"callStack" query:"callStack" validate:"required"` // contains filtered or unexported fields }
func FormatWithCause
deprecated
func (*Error) CopyAsInterface ¶
func (v *Error) CopyAsInterface() interface{}
func (*Error) MarshalBinary ¶
func (*Error) MarshalJSON ¶
func (*Error) Print ¶
Print prints an error message plus its call stack and causal chain. Compound errors are usually formatted as '<description>: <cause>'. Print will print this out as:
<description>: <call stack> <cause> <call stack>
func (*Error) PrintFullCallstack ¶
func (*Error) UnmarshalBinary ¶
func (*Error) UnmarshalJSON ¶
type Skip ¶ added in v1.1.0
type Skip struct {
// contains filtered or unexported fields
}
func (Skip) WithCauseAndFormat ¶ added in v1.1.0
func (Skip) WithFormat ¶ added in v1.1.0
type Status ¶
type Status uint64
Status is a request status code.
const BadRequest Status = 400
BadRequest means the request was invalid.
const BadSignerVersion Status = 411
BadSignerVersion means the signer version does not match.
const BadTimestamp Status = 412
BadTimestamp means the timestamp is invalid.
const BadUrlLength Status = 413
BadUrlLength means the url length is too big.
const Conflict Status = 409
Conflict means the request failed due to a conflict.
const Delivered Status = 201
Delivered means the transaction has been delivered.
const EncodingError Status = 502
EncodingError means encoding or decoding failed.
const FatalError Status = 503
FatalError means something has gone seriously wrong.
const IncompleteChain Status = 414
IncompleteChain means the chain does not include the full history.
const InsufficientBalance Status = 415
InsufficientBalance means the account balance is insufficient to satisfy the request.
const InsufficientCredits Status = 402
InsufficientCredits means the signer does not have sufficient credits to execute the transaction.
const InternalError Status = 500
InternalError means an internal error occurred.
const NoPeer Status = 506
NoPeer means the receiver cannot find a peer to satisfy the request.
const NotAllowed Status = 405
NotAllowed means the requested action could not be performed.
const NotFound Status = 404
NotFound means a record could not be found.
const NotReady Status = 504
NotReady means the receiver is not ready to satisfy the request.
const OK Status = 200
OK means the request completed successfully.
const PeerMisbehaved Status = 507
PeerMisbehaved means a peer behaved incorrectly.
const Pending Status = 202
Pending means the transaction is pending.
const Remote Status = 203
Remote means the transaction is a local reference to a remote.
const Unauthenticated Status = 401
Unauthenticated means the signature could not be validated.
Unauthorized means the signer is not authorized to sign the transaction.
const UnknownError Status = 501
UnknownError means an unknown error occurred.
const WrongPartition Status = 301
WrongPartition means the requested resource is assigned to a different network partition.
const WrongType Status = 505
WrongType means the record is not the expected type.
func StatusByName ¶
StatusByName returns the named Status.
func (Status) GetEnumValue ¶
GetEnumValue returns the value of the Status
func (Status) IsClientError ¶ added in v1.1.0
IsClientError returns true if the status is a server error.
func (Status) IsKnownError ¶ added in v1.1.0
IsKnownError returns true if the status is non-zero and not UnknownError.
func (Status) IsServerError ¶ added in v1.1.0
IsServerError returns true if the status is a server error.
func (Status) MarshalJSON ¶
MarshalJSON marshals the Status to JSON as a string.
func (*Status) SetEnumValue ¶
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (*Status) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Status from JSON as a string.