util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserError

func NewUserError(code codes.Code, message string) error

NewUserError returns an instance of UserError with the appropriate code and message

func NewUserErrorWrap

func NewUserErrorWrap(err error, entity string) error

NewUserErrorWrap wraps pq errors and returns an instance of UserError

Types

type UserError added in v0.11.0

type UserError struct {
	Code    codes.Code
	Message string
}

UserError implements a new error type for user facing errors

func (*UserError) Error added in v0.11.0

func (e *UserError) Error() string

Error returns error messages

func (*UserError) GRPCStatus added in v0.11.0

func (e *UserError) GRPCStatus() *status.Status

GRPCStatus is used by gRPC to return the correct gRPC status codes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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