err

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError

type AuthError struct {
	ServerError
	Token string
}

AuthError result from bad auth.

func (AuthError) Error

func (e AuthError) Error() string

Error returns the string error.

func (AuthError) GRPCResponseCode

func (e AuthError) GRPCResponseCode() codes.Code

GRPCResponseCode returns a gRPC response code.

func (AuthError) HTTPResponseCode

func (e AuthError) HTTPResponseCode() int

HTTPResponseCode returns an HTTP response code.

type BadArgumentError

type BadArgumentError struct {
	ServerError
	Err error
}

BadArgumentError result from bad inputs.

func (BadArgumentError) Error

func (e BadArgumentError) Error() string

Error returns the string error.

func (BadArgumentError) GRPCResponseCode

func (e BadArgumentError) GRPCResponseCode() codes.Code

GRPCResponseCode returns a gRPC response code.

func (BadArgumentError) HTTPResponseCode

func (e BadArgumentError) HTTPResponseCode() int

HTTPResponseCode returns an HTTP response code.

type RedisError

type RedisError struct {
	ServerError
	Err error
}

RedisError result from Redis issues.

func (RedisError) Error

func (e RedisError) Error() string

Error returns the string error.

func (RedisError) GRPCResponseCode

func (e RedisError) GRPCResponseCode() codes.Code

GRPCResponseCode returns a gRPC response code.

func (RedisError) HTTPResponseCode

func (e RedisError) HTTPResponseCode() int

HTTPResponseCode returns an HTTP response code.

type ServerError

type ServerError interface {
	GRPCResponseCode() codes.Code
	HTTPResponseCode() int
	Error() string
}

ServerError defines a server error interface.

func ErrorToServerError

func ErrorToServerError(err error) ServerError

ErrorToServerError will attempt to convert a standard error to a ServerError. If unable to do so, it will return an UnknownError.

func NewAuthError

func NewAuthError(token string) ServerError

NewAuthError creates a new ServerError for auth related errors.

func NewBadArgumentError

func NewBadArgumentError(err error) ServerError

NewBadArgumentError creates a new ServerError for bad inputs.

func NewRedisError

func NewRedisError(err error) ServerError

NewRedisError creates a new ServerError for Redis related errors.

func NewUnknownError

func NewUnknownError(err error) ServerError

NewUnknownError creates a new ServerError for unknown errors.

type UnknownError

type UnknownError struct {
	ServerError
	Err error
}

UnknownError result from bad inputs.

func (UnknownError) Error

func (e UnknownError) Error() string

Error returns the string error.

func (UnknownError) GRPCResponseCode

func (e UnknownError) GRPCResponseCode() codes.Code

GRPCResponseCode returns a gRPC response code.

func (UnknownError) HTTPResponseCode

func (e UnknownError) HTTPResponseCode() int

HTTPResponseCode returns an HTTP response code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳