apierrors

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorDescriptionMalformedRequest  = "Unable to process request due to a malformed or invalid request body or query parameter"
	ErrorDescriptionMissingParameters = "Unable to process request due to missing required parameters in the request body or query parameters"
	ErrorDescriptionNotFound          = "The requested resource does not exist"
	ErrorDescriptionInternalError     = "Failed to process the request due to an internal error"
)

Response error descriptions

View Source
var (
	ErrUnableToReadMessage = errors.New("failed to read message body")
	ErrUnableToParseJSON   = errors.New("failed to parse json body")
)
View Source
var (
	ErrUnmarshalJSONObject    = "Failed to unmarshal bundle resource into bytes"
	ErrMarshalJSONObject      = "Failed to Marshal bundle resource into bytes"
	ErrWritingBytesToResponse = "Failed writing bytes to response"
)
View Source
var (
	// Generic Errors
	ErrInternalServer = errors.New("internal error")
	ErrInvalidBody    = errors.New("invalid request body")
	ErrNotFound       = errors.New("not found")
	ErrUnauthorised   = errors.New("unauthorised access to API")

	// Bundle-Specific
	ErrBundleNotFound         = errors.New("bundle not found")
	ErrDeleteBundleForbidden  = errors.New("cannot delete a published bundle")
	ErrBundleAlreadyExists    = errors.New("bundle already exists")
	ErrInvalidBundleState     = errors.New("invalid bundle state")
	ErrMissingBundleID        = errors.New("missing bundle ID")
	ErrInvalidBundleReference = errors.New("invalid bundle reference")
	ErrBundleEventNotFound    = errors.New("bundle event not found")

	// Validation
	ErrMissingParameters      = errors.New("missing required parameters in request")
	ErrInvalidQueryParameter  = errors.New("invalid query parameter")
	ErrTooManyQueryParameters = errors.New("too many query parameters provided")

	// State errors
	ErrExpectedStateOfCreated  = errors.New("expected bundle state to be 'CREATED'")
	ErrExpectedStateOfApproved = errors.New("expected bundle state to be 'APPROVED'")
)

Core errors for dis-bundle-api

400 Bad Request

View Source
var ConflictMap = map[error]bool{
	ErrBundleAlreadyExists: true,
}

409 Conflict

403 Forbidden

404 Not Found

Functions

This section is empty.

Types

type ErrInvalidPatch

type ErrInvalidPatch struct {
	Msg string
}

Custom error types for common HTTP cases

func (ErrInvalidPatch) Error

func (e ErrInvalidPatch) Error() string

Jump to

Keyboard shortcuts

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