...

Package errors

import "golang.conradwood.net/go-easyops/errors"
Overview
Index
Subdirectories

Overview ▾

wrappers around errors to include more information than standard fmt.Errorf through use of context information

func AccessDenied

func AccessDenied(ctx context.Context, logmessage string, a ...interface{}) error

func AlreadyExists

func AlreadyExists(ctx context.Context, logmessage string, a ...interface{}) error

func Error

func Error(ctx context.Context, code codes.Code, publicmessage string, logmessage string, a ...interface{}) error

really returns a status.Status

func ErrorString

func ErrorString(err error) string

func ErrorStringWithStackTrace

func ErrorStringWithStackTrace(err error) string

func Errorf

func Errorf(format string, args ...interface{}) error

create new error, but include "[file: xxx.go:13]"

func FailedPrecondition

func FailedPrecondition(ctx context.Context, logmessage string, a ...interface{}) error

func InvalidArgs

func InvalidArgs(ctx context.Context, publicmessage string, logmessage string, a ...interface{}) error

shortcut: we write this so often: user submitted args that aren't valid

func NeedServiceOrRoot

func NeedServiceOrRoot(ctx context.Context, serviceids []string) error

error if context is not root user or one of the services listed

func NeedsRoot

func NeedsRoot(ctx context.Context) error

function call requires "root" privileges. returns error if user is non-root

func NotFound

func NotFound(ctx context.Context, logmessage string, a ...interface{}) error

func NotImplemented

func NotImplemented(ctx context.Context, method string) error

func ShortMessage

func ShortMessage(err error) string

func Unauthenticated

func Unauthenticated(ctx context.Context, logmessage string, a ...interface{}) error

func Unavailable

func Unavailable(ctx context.Context, method string) error

func Wrap

func Wrap(err error) error

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

type GEEntry

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

type GEError

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

func UnmarshalError

func UnmarshalError(err error) *GEError

func (*GEError) MultilineError

func (g *GEError) MultilineError() string

type HTTPError

type HTTPError struct {
    ErrorCode           int
    ErrorString         string
    ExtendedErrorString string
    ErrorMessage        string
}

func ToHTTPCode

func ToHTTPCode(err error) *HTTPError

Subdirectories

Name Synopsis
..
shared