package errors
import "github.com/influxdata/influxdb/kit/errors"
Index ¶
- Constants
- func BadRequestError(msg string) error
- func Errorf(ref int, format string, i ...interface{}) error
- func Forbiddenf(format string, i ...interface{}) error
- func InternalErrorf(format string, i ...interface{}) error
- func InvalidDataf(format string, i ...interface{}) error
- func MalformedDataf(format string, i ...interface{}) error
- func New(msg string, ref ...int) error
- func Wrap(err error, msg string, ref ...int) error
- type Error
- type List
Constants ¶
const ( // InternalError indicates an unexpected error condition. InternalError = 1 // MalformedData indicates malformed input, such as unparsable JSON. MalformedData = 2 // InvalidData indicates that data is well-formed, but invalid. InvalidData = 3 // Forbidden indicates a forbidden operation. Forbidden = 4 // NotFound indicates a resource was not found. NotFound = 5 )
Functions ¶
func BadRequestError ¶
func Errorf ¶
Errorf constructs an Error with the given reference code and format.
func Forbiddenf ¶
Forbiddenf constructs a Forbidden error with the given format.
func InternalErrorf ¶
InternalErrorf constructs an InternalError with the given format.
func InvalidDataf ¶
InvalidDataf constructs an InvalidData error with the given format.
func MalformedDataf ¶
MalformedDataf constructs a MalformedData error with the given format.
func New ¶
New creates a new error with a message and error code.
func Wrap ¶
Types ¶
type Error ¶
type Error struct { Reference int `json:"referenceCode"` Code int `json:"statusCode"` Err string `json:"err"` }
Error indicates an error with a reference code and an HTTP status code.
func (Error) Error ¶
Error implements the error interface.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List represents a list of errors.
func (*List) Append ¶
Append adds err to the errors list.
func (*List) AppendString ¶
AppendString adds a new error that formats as the given text.
func (*List) Clear ¶
func (l *List) Clear()
Clear removes all the previously appended errors from the list.
func (*List) Err ¶
Err returns an error composed of the list of errors, separated by a new line, or nil if no errors were appended.
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 2 days ago –
Tools for package owners.