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 ¶
- Variables
- func NewGrammesError(function string, err error) error
- func NewNetworkError(statusCode int, msg string, origMsg string) error
- func NewQueryError(function, query string, err error) error
- func NewUnmarshalError(function string, rawBytes []byte, err error) error
- type GrammesError
- type NetworkError
- type QueryError
- type UnmarshalError
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 ¶
NewGrammesError returns a new generic error for when something goes wrong in a Grammes package function.
func NewNetworkError ¶
NewNetworkError returns a status code related error.
func NewQueryError ¶
NewQueryError returns a new QueryError 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
Click to show internal directories.
Click to hide internal directories.