gremerror

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package gremerror holds custom error types to return in the Grammes package.

All exported functions in this package returns an object that implements the error interface.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOddNumberOfParameters is used when there
	// are an odd number of parameters fed into a
	// function that should only have paired parameters.
	ErrOddNumberOfParameters = errors.New("odd number of parameters")
	// ErrDisposedConnection is used when the connection from the
	// dialer is disposed and not reachable.
	ErrDisposedConnection = errors.New("connection is disposed")
	// ErrNilClient is used for functions that have a queryClient as
	// a parameter, and the client is nil.
	ErrNilClient = errors.New("nil client given to function")
	// ErrEmptyResponse is used when the response given back from
	// querying was empty. This is used on rare occasions when
	// the Unmarshal process is successful, but returns something empty.
	ErrEmptyResponse = errors.New("empty response received")
)

Functions

func NewGrammesError

func NewGrammesError(function string, err error) error

NewGrammesError returns a new generic error for when something goes wrong in a Grammes package function.

func NewNetworkError

func NewNetworkError(statusCode int, msg string, origMsg string) error

NewNetworkError returns a status code related error.

func NewQueryError

func NewQueryError(function, query string, err error) error

NewQueryError returns a new QueryError with specified parameters.

func NewUnmarshalError

func NewUnmarshalError(function string, rawBytes []byte, err error) error

NewUnmarshalError returns a new UnmarshalError with specified parameters.

Types

type GrammesError

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

GrammesError is a generic error used when something nonspecific is wrong inside a Grammes function.

func (*GrammesError) Error

func (g *GrammesError) Error() string

type NetworkError

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

NetworkError is used when handling status codes.

func (*NetworkError) Error

func (g *NetworkError) Error() string

type QueryError

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

QueryError is specific to a query related function.

func (*QueryError) Error

func (q *QueryError) Error() string

type UnmarshalError

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

UnmarshalError is specific to JSON unmarshalling.

func (*UnmarshalError) Error

func (u *UnmarshalError) Error() string

Jump to

Keyboard shortcuts

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