errors

package
v0.0.0-...-74c185a Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package errors GENERATED BY gengo:runtimedoc DON'T EDIT THIS FILE

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidationError

func IsValidationError(err error) bool

func Join

func Join(errors ...error) error

func PrefixJSONPointer

func PrefixJSONPointer(err error, pointer jsontext.Pointer) error

func SuffixJSONPointer

func SuffixJSONPointer(err error, suffix jsontext.Pointer) error

func WrapLocation

func WrapLocation(err error, location string) error

Types

type ErrInvalidType

type ErrInvalidType struct {
	Type  string
	Value any
	// contains filtered or unexported fields
}

func (*ErrInvalidType) Error

func (e *ErrInvalidType) Error() string

func (ErrInvalidType) RuntimeDoc

func (v ErrInvalidType) RuntimeDoc(names ...string) ([]string, bool)

func (ErrInvalidType) ValidationError

func (ErrInvalidType) ValidationError()

type ErrMissingRequired

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

func (*ErrMissingRequired) Error

func (*ErrMissingRequired) Error() string

func (ErrMissingRequired) ValidationError

func (ErrMissingRequired) ValidationError()

type ErrMultipleOf

type ErrMultipleOf struct {
	Topic      string
	Current    any
	MultipleOf any
	// contains filtered or unexported fields
}

func (*ErrMultipleOf) Error

func (e *ErrMultipleOf) Error() string

func (ErrMultipleOf) RuntimeDoc

func (v ErrMultipleOf) RuntimeDoc(names ...string) ([]string, bool)

func (ErrMultipleOf) ValidationError

func (ErrMultipleOf) ValidationError()

type ErrNotMatch

type ErrNotMatch struct {
	Topic   string
	Current any
	Pattern string
	// contains filtered or unexported fields
}
Example
fmt.Println(&ErrNotMatch{
	Topic:   "value",
	Current: "1",
	Pattern: `/\d+/`,
})
Output:

value should match /\d+/, but got 1

func (*ErrNotMatch) Error

func (err *ErrNotMatch) Error() string

func (ErrNotMatch) RuntimeDoc

func (v ErrNotMatch) RuntimeDoc(names ...string) ([]string, bool)

func (ErrNotMatch) ValidationError

func (ErrNotMatch) ValidationError()

type NotInEnumError

type NotInEnumError struct {
	Topic   string
	Current any
	Enums   []any
	// contains filtered or unexported fields
}
Example
fmt.Println(&NotInEnumError{
	Topic:   "value",
	Current: "11",
	Enums: []any{
		"1", "2", "3",
	},
})
Output:

value should be one of 1, 2, 3, but got 11

func (*NotInEnumError) Error

func (e *NotInEnumError) Error() string

func (NotInEnumError) RuntimeDoc

func (v NotInEnumError) RuntimeDoc(names ...string) ([]string, bool)

func (NotInEnumError) ValidationError

func (NotInEnumError) ValidationError()

type OutOfRangeError

type OutOfRangeError struct {
	Topic            string
	Current          any
	Minimum          any
	Maximum          any
	ExclusiveMaximum bool
	ExclusiveMinimum bool
	// contains filtered or unexported fields
}
Example
fmt.Println(&OutOfRangeError{
	Topic:            "value",
	Minimum:          "1",
	Maximum:          "10",
	Current:          "11",
	ExclusiveMinimum: true,
	ExclusiveMaximum: true,
})
Output:

value should be larger than 1 and less than 10, but got 11

func (*OutOfRangeError) Error

func (e *OutOfRangeError) Error() string

func (OutOfRangeError) RuntimeDoc

func (v OutOfRangeError) RuntimeDoc(names ...string) ([]string, bool)

func (OutOfRangeError) ValidationError

func (OutOfRangeError) ValidationError()

type ValidationError

type ValidationError interface {
	ValidationError()
}

Jump to

Keyboard shortcuts

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