Skip to content
Snippets Groups Projects
Select Git revision
  • main default protected
  • v0.12.6
  • v0.12.5
  • v0.12.4
  • v0.12.3
  • v0.12.2
  • v0.12.1
  • v0.12.0
  • v0.11.1
  • v0.11.0
  • v0.10.0
  • v0.9.9
  • v0.9.8
  • v0.9.7
  • v0.9.6
  • v0.9.5
  • v0.9.4
  • v0.9.3
  • v0.9.2
  • v0.9.1
  • v0.8.1
21 results

errors.go

errors.go 1.61 KiB
package wc

import (
	"gitlab.com/golang-utils/errors"
)

var (
	ErrNotFound    = errors.Error("not found: %v")
	ErrUnexpected  = errors.Error("unexpected: %v")
	ErrInvalidType = errors.Error("invalid type: %T (expected %T)")
	ErrMissing     = errors.Error("missing: %s")
	ErrForbidden   = errors.Error("forbidden: %s")
)

var (
	ErrWrongContentType = errors.Error("wrong content type: %s (expected %s)")
	ErrValidation       = errors.Error("validation error: %w")
)

var (
	ErrArgNotFound     = errors.Error("argument with name %q could not be found")
	ErrArgExists       = errors.Error("argument with name %q already exists")
	ErrArgMissing      = errors.Error("missing argument %q of source %q")
	ErrArgNotInRequest = errors.Error("argument %q of type %s not in request")
	ErrArgUnknown      = errors.Error("unknown argument %q given")
	ErrArgInvalidType  = errors.Error("invalid type for argument %s: %T (expected %T)")
)

var (
	ErrPathArgNotRegistered           = errors.Error("path argument %q from path string %q not registered")
	ErrPathArgRegisteredWithWrongType = errors.Error("path argument %q from path string %q registered with wrong path type (%q)")
	ErrPathArgRegisteredNotInPath     = errors.Error("path argument %q registered, but not inside path string %q")
)

var (
	ErrFormArg = errors.Error("form argument %q given")
)

var (
	ErrClientRequest           = errors.Error("error while making a request as a client: %w")
	ErrFormArgsAndBody         = errors.Error("form arguments (%#v) and a body can't be passed at the same time")
	ErrBodyNotAllowedForMethod = errors.Error("transmitting a form for method %s is not allowed")
)