errors

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: MIT Imports: 8 Imported by: 1

README

Kviky package used together with go-swagger to produce standardized set of errors in ProblemDetails https://tools.ietf.org/html/rfc7807 format.

Documentation

Index

Constants

View Source
const (
	InstApp      = "app"
	InstImage    = "image"
	InstApi      = "api"
	InstIdentity = "identity"
	InstClient   = "client"
	InstDB       = "database"
)

Types of instances

View Source
const (
	AlreadyExists           = "Already exists!"
	ImageNotDeleted         = "Image cannot be deleted!"
	ImageNotUploaded        = "Image cannot be uploaded!"
	BadRequest              = "Bad request!"
	CharterHasListings      = "Charter cannot be deleted!"
	CharterNotCreated       = "Charter not created!"
	InactiveListing         = "Inactive Listing!"
	InvalidMsgFormat        = "Invalid message format!"
	InvalidBodyParam        = "Invalid body parameter!"
	InvalidDates            = "Invalid dates!"
	InvalidHeaderParam      = "Invalid header parameter!"
	InvalidOwnerListing     = "Invalid owner listing!"
	InvalidQueryParam       = "Invalid query parameter!"
	InvalidPathParam        = "Invalid path parameter!"
	ListingNotCreated       = "Listing not created!"
	LocationNotCreated      = "Location not created!"
	MandatoryParamIncorrect = "Mandatory parameter incorrect!"
	MandatoryParamMissing   = "Mandatory parameter missing!"
	NameAlreadyTaken        = "Name is already taken!"
	PortAlreadyExists       = "Port name exists already!"
	ReservationNotCreated   = "Reservation not created!"
)

List of 400 errors

View Source
const (
	InvalidAuthToken   = "Invalid authorization token!"
	MissingAuthToken   = "Missing authorization token!"
	UnauthorizedAccess = "Unauthorized access!"
)

List of 401 errors

View Source
const (
	ForbiddenAction   = "Forbidden action!"
	ForbiddenResource = "Forbidden resource!"
	ForbiddenUpload   = "Forbidden upload!"
)

List of 403 errors

View Source
const (
	CharterNotFound  = "Charter not found!"
	ListingNotFound  = "Listing not found!"
	LocationNotFound = "Location not found!"
	ResourceNotFound = "Resource not found!"
	UserNotFound     = "User not found!"
	UsersNotFound    = "Users not found!"
)

list of 404 errors

View Source
const (
	SystemFailure      = "System failure!"
	UnspecifiedFailure = "Unspecified failure!"
)

List of 500 errors

View Source
const (
	MethodNotAllowed = "Method not allowed!"
)

list of 405 errors

Variables

This section is empty.

Functions

func CreateProblemDetails

func CreateProblemDetails(errorName string) *models.ProblemDetails

CreateProblemDetails - Helper function to create ProblemDetails object

func NewImageSizeError added in v1.0.5

func NewImageSizeError(size int64) *models.InvalidParam

func NewImageSizePxError added in v1.0.5

func NewImageSizePxError(name string, px int) *models.InvalidParam

func NewInvalidParam

func NewInvalidParam(name string) *models.InvalidParam

func NewMissingParam

func NewMissingParam(name string) *models.InvalidParam

func ServeError

func ServeError(rw http.ResponseWriter, r *http.Request, err error)

ServeError the error handler interface implementation

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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