errors

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRowsAffected = errors.New("no rows affected")

ErrNoRowsAffected is sent whenever there is a successful query, but no rows were affected with the query.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned is a resource cannot be found.

Functions

This section is empty.

Types

type Message

type Message struct {
	// The error code
	// in: body
	Code int `json:"code"`
	// The error message
	// in: body
	Message string `json:"message"`
	// The error itself coming from the backend
	// in: body
	Error string `json:"error"`
}

Message represents an error message. swagger:response

func APIError

func APIError(m string, code int, err error) Message

APIError wraps a message and a code into a struct for JSON parsing.

type QueryError

type QueryError struct {
	Query string
	Err   error
}

QueryError defines an error which occurs when doing database operations.

func (*QueryError) Error

func (e *QueryError) Error() string

func (*QueryError) Unwrap

func (e *QueryError) Unwrap() error

Unwrap unwraps the query error and returns the internal error.

Jump to

Keyboard shortcuts

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