errors

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 107

Documentation

Index

Constants

View Source
const (
	StatusBadParameter  = "Bad Parameter"
	StatusBadRequest    = "Bad Request"
	StatusUnknown       = "Unknown"
	StatusIncorrectXml  = "Incorrect Xml"
	StatusIncorrectJson = "Incorrect Json"
	StatusNotUnique     = "Not Unique"
	StatusForbidden     = "Forbidden"
	StatusNotAllowed    = "Not Allowed"
	ArgumentIsEmpty     = "ArgumentIsEmpty"
)
View Source
const (
	ErrEntityExists          = "entity exists"
	ErrOperationFailure      = "operation failure"
	ErrEntityNotFound        = "entity not found"
	ErrStructArgIsNil        = "input structure is nil"
	ErrStructOutIsNil        = "output structure is nil"
	ErrStructArgIsInvalid    = "input structure is invalid"
	ErrStructOutIsInvalid    = "output structure is invalid"
	ErrStructOutIsNotPointer = "output structure is not pointer"
)
View Source
const (
	VolumeIsNotReady                   = "volume is not ready"
	VolumeIsNotProvisioned             = "volume is not provisioned"
	VolumeNotFound                     = "volume not found"
	VolumesProvisionedOnDifferentNodes = "volumes are binded to different nodes"
)
View Source
const IngressNotFound = "IngressNotFound"
View Source
const NodeNotFound = "NodeNotFound"
View Source
const PodNotFound = "PodNotFound"
View Source
const ResourcesCpuLimitExceeded = "resources cpu limit exceeded"
View Source
const ResourcesCpuLimitIsRequired = "resources cpu limit is required"
View Source
const ResourcesRamLimitExceeded = "resources ram limit exceeded"
View Source
const ResourcesRamLimitIsRequired = "resources ram limit is required"
View Source
const (
	ServiceIsBindedToRoute = "service is binded to route"
)

Variables

View Source
var (
	NotLoggedMessage   = errors.New("You are currently not logged in to the system, to get proper access create a new user or login with an existing user.")
	LoginErrorMessage  = errors.New("Incorrect login or password")
	LogoutErrorMessage = errors.New("Some problems with logout")
	UnknownMessage     = errors.New("Oops, error occurred: Please provide bug to github: https://github.com/lastbackend/registry/issues")
)

Functions

func New

func New(text string) *err

func Storage

func Storage() storage

Types

type Err

type Err struct {
	Code string
	Attr string
	// contains filtered or unexported fields
}

func BadParameter

func BadParameter(attr string, e ...error) *Err

func Forbidden

func Forbidden(e ...error) *Err

func IncorrectJSON

func IncorrectJSON(e ...error) *Err

func IncorrectXML

func IncorrectXML(e ...error) *Err

func NotAllowed

func NotAllowed(e ...error) *Err

func Unknown

func Unknown(e ...error) *Err

func (*Err) Err

func (e *Err) Err() error

func (*Err) Http

func (e *Err) Http(w http.ResponseWriter)

func (*Err) SetMessage

func (e *Err) SetMessage(s string) *Err

type Http

type Http struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message"`
}
var HTTP Http

func (Http) BadGateway

func (Http) BadGateway(w http.ResponseWriter)

func (Http) BadParameter

func (Http) BadParameter(w http.ResponseWriter, args ...string)

func (Http) BadRequest

func (Http) BadRequest(w http.ResponseWriter, msg ...string)

func (Http) Forbidden

func (Http) Forbidden(w http.ResponseWriter, msg ...string)

func (Http) InternalServerError

func (Http) InternalServerError(w http.ResponseWriter, msg ...string)

func (Http) InvalidJSON

func (Http) InvalidJSON(w http.ResponseWriter, msg ...string)

func (Http) InvalidXML

func (Http) InvalidXML(w http.ResponseWriter, msg ...string)

func (Http) NotAllowed

func (Http) NotAllowed(w http.ResponseWriter, msg ...string)

func (Http) NotFound

func (Http) NotFound(w http.ResponseWriter, args ...string)

func (Http) NotImplemented

func (Http) NotImplemented(w http.ResponseWriter, msg ...string)

func (Http) PaymentRequired

func (Http) PaymentRequired(w http.ResponseWriter, msg ...string)

func (Http) Unauthorized

func (Http) Unauthorized(w http.ResponseWriter, msg ...string)

type ServiceError

type ServiceError struct {
}

func (*ServiceError) RouteBinded

func (ve *ServiceError) RouteBinded(route string) error

type VolumeError

type VolumeError struct {
}

func (*VolumeError) DifferentNodes

func (ve *VolumeError) DifferentNodes() error

func (*VolumeError) NotFound

func (ve *VolumeError) NotFound(vol string) error

func (*VolumeError) NotProvisioned

func (ve *VolumeError) NotProvisioned(vol string) error

func (*VolumeError) NotReady

func (ve *VolumeError) NotReady(vol string) error

Jump to

Keyboard shortcuts

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