errs

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 4 Imported by: 0

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 FailedToBeginTx

func FailedToBeginTx(err error) error

FailedToBeginTx wraps error returned from failed transaction to a status error

func FailedToCommitTx

func FailedToCommitTx(err error) error

FailedToCommitTx wraps error returned from failed commit of transaction to a status error

func FailedToDecrypt

func FailedToDecrypt(err error) error

FailedToDecrypt is status error from failed decryption operation

func FailedToDelete

func FailedToDelete(resource string, err error) error

FailedToDelete wraps error returned from failed delete operation to a status error

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 FailedToFind

func FailedToFind(resource string, err error) error

FailedToFind wraps error returned from failed find operation to a status error

func FailedToGetToken

func FailedToGetToken(err error) error

FailedToGetToken wraps the error returned while getting token to a status error

func FailedToRollbackTx

func FailedToRollbackTx(err error) error

FailedToRollbackTx wraps error returned from failed rollback of transaction to a status error

func FailedToSave

func FailedToSave(resource string, err error) error

FailedToSave is status error returned from failed save operation

func FailedToUpdate

func FailedToUpdate(resource string, err error) error

FailedToUpdate wraps error returned from failed update operation to a status error

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 NilObject

func NilObject(object string) error

NilObject is error resulting from using nil references to objects

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 RedisCmdFailed

func RedisCmdFailed(err error, command string) error

RedisCmdFailed wraps error returned from a failed redis command to a status error

func SQLQueryFailed

func SQLQueryFailed(err error, queryType string) error

SQLQueryFailed wraps a sql query error to a status error

func TokenCredentialNotMatching

func TokenCredentialNotMatching(cred string) error

TokenCredentialNotMatching creates a status error caused by mismatch in token credential

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 WrapUserError

func WrapUserError(err error, userMsg string) error

WrapUserError adds user facing message as details to 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