errs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertingType

func ConvertingType(err error, from, to string) error

ConvertingType wraps error that occured during type assertion to grpc status error

func DoesExist

func DoesExist(resource, id string) error

DoesExist returns status error indicating the resource does exist

func DoesNotExist

func DoesNotExist(resource, id string) error

DoesNotExist returns status error indicating that the resource does not exist

func DuplicateField

func DuplicateField(fieldName, fieldValue string) error

DuplicateField returns a status error for a duplicate field

func FailedToDecrypt

func FailedToDecrypt(err error) error

FailedToDecrypt is status error from failed decryption operation

func FailedToEncrypt

func FailedToEncrypt(err error) error

FailedToEncrypt is status error from failed encryption operation

func FailedToExecuteTemplate

func FailedToExecuteTemplate(err error) error

FailedToExecuteTemplate returns a status error for a failed template execution

func FromJSONMarshal

func FromJSONMarshal(err error, obj string) error

FromJSONMarshal wraps error returned from json.Marshal to a status error

func FromJSONUnMarshal

func FromJSONUnMarshal(err error, obj string) error

FromJSONUnMarshal wraps error returned from json.Unmarshal to a status error

func FromProtoMarshal

func FromProtoMarshal(err error, obj string) error

FromProtoMarshal wraps error returned from proto.Marshal to a status error

func FromProtoUnMarshal

func FromProtoUnMarshal(err error, obj string) error

FromProtoUnMarshal wraps error returned from proto.Unmarshal to a status error

func IncorrectVal

func IncorrectVal(val string) error

IncorrectVal returns a status error indicating val was incorrect

func MissingField

func MissingField(field string) error

MissingField returns a status error caused by a missing message field

func Panic

func Panic(err error)

Panic on error

func ReadFailed

func ReadFailed(err error) error

ReadFailed returns a status error for a read operation error

func WrapError

func WrapError(err error) error

WrapError is a wraps generic error to a status error

func WrapErrorWithCode

func WrapErrorWithCode(code codes.Code, err error) error

WrapErrorWithCode is a wraps generic error to a status error with provided code

func WrapErrorWithCodeAndMsg

func WrapErrorWithCodeAndMsg(code codes.Code, err error, msg string) error

WrapErrorWithCodeAndMsg wraps generic error to a status error with provided code and msg

func WrapErrorWithCodeAndMsgFunc

func WrapErrorWithCodeAndMsgFunc(msg string) func(codes.Code, error) error

WrapErrorWithCodeAndMsgFunc is a common message wrapper for WrapErrorWithCodeAndMsg

func WrapErrorWithMsg

func WrapErrorWithMsg(err error, msg string) error

WrapErrorWithMsg is a wraps generic error to a status error with code and msg formt

func WrapErrorWithMsgFunc

func WrapErrorWithMsgFunc(msg string) func(error) error

WrapErrorWithMsgFunc is a common message wrapper for WrapErrorWithMsg

func WrapMessage

func WrapMessage(code codes.Code, msg string) error

WrapMessage is a wraps message provided to a status error

func WrapMessagef

func WrapMessagef(code codes.Code, format string, args ...interface{}) error

WrapMessagef is a wraps message provided to a status error

func WriteFailed

func WriteFailed(err error) error

WriteFailed returns a status error for a write operation error

Types

This section is empty.

Jump to

Keyboard shortcuts

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