apierrors

package
v1.128.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 1 Imported by: 4 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddDatasetAlreadyExists                 = errors.New("dataset already exists")
	ErrAddDatasetTitleAlreadyExists            = errors.New("dataset title already exists")
	ErrDatasetTypeInvalid                      = errors.New("invalid dataset type")
	ErrTypeMismatch                            = errors.New("type mismatch")
	ErrAddUpdateDatasetBadRequest              = errors.New("failed to parse json body")
	ErrConflictUpdatingInstance                = errors.New("conflict updating instance resource")
	ErrDatasetNotFound                         = errors.New("dataset not found")
	ErrDeletePublishedDatasetForbidden         = errors.New("a published dataset cannot be deleted")
	ErrDeletePublishedVersionForbidden         = errors.New("a published version cannot be deleted")
	ErrDimensionNodeNotFound                   = errors.New("dimension node not found")
	ErrDimensionNotFound                       = errors.New("dimension not found")
	ErrDimensionOptionNotFound                 = errors.New("dimension option not found")
	ErrDimensionsNotFound                      = errors.New("dimensions not found")
	ErrEditionNotFound                         = errors.New("edition not found")
	ErrEditionsNotFound                        = errors.New("no editions were found")
	ErrIncorrectStateToDetach                  = errors.New("only versions with a state of edition-confirmed or associated can be detached")
	ErrInstanceNotFound                        = errors.New("instance not found")
	ErrInstanceConflict                        = errors.New("instance does not match the expected eTag")
	ErrInternalServer                          = errors.New("internal error")
	ErrInsertedObservationsInvalidSyntax       = errors.New("inserted observation request parameter not an integer")
	ErrInvalidQueryParameter                   = errors.New("invalid query parameter")
	ErrInvalidBody                             = errors.New("invalid request body")
	ErrTooManyQueryParameters                  = errors.New("too many query parameters have been provided")
	ErrMetadataVersionNotFound                 = errors.New("version not found")
	ErrMissingJobProperties                    = errors.New("missing job properties")
	ErrMissingParameters                       = errors.New("missing properties in JSON")
	ErrResourcePublished                       = errors.New("unable to update resource as it has been published")
	ErrResourceState                           = errors.New("incorrect resource state")
	ErrUnableToParseJSON                       = errors.New("failed to parse json body")
	ErrUnableToReadMessage                     = errors.New("failed to read message body")
	ErrUnauthorised                            = errors.New("unauthorised access to API")
	ErrVersionMissingState                     = errors.New("missing state from version")
	ErrVersionNotFound                         = errors.New("version not found")
	ErrVersionsNotFound                        = errors.New("no versions were found")
	ErrInvalidVersion                          = errors.New("invalid version requested")
	ErrVersionAlreadyExists                    = errors.New("an unpublished version of this dataset already exists")
	ErrNotFound                                = errors.New("not found")
	ErrMissingDatasetID                        = errors.New("invalid fields: missing dataset id in request body")
	ErrEditionAlreadyExists                    = errors.New("the edition already exists")
	ErrEditionTitleAlreadyExists               = errors.New("the edition-title already exists")
	ErrInvalidDatasetTypeForEditionUpdate      = errors.New("unable to update edition-id, invalid dataset type")
	ErrInvalidID                               = errors.New("id must only contain letters, numbers, and dashes")
	ErrCannotChangeIDForPublishedDataset       = errors.New("cannot change the dataset ID for a published dataset")
	ErrCannotChangeDatasetIDForMigratedDataset = errors.New("cannot change the dataset ID for a migrated dataset")
	ErrCannotChangeEditionIDForMigratedEdition = errors.New("cannot change the edition ID for a migrated edition")
	ErrFileMetadataNotFound                    = errors.New("file metadata not found")
	ErrFileNotInCorrectState                   = errors.New("file not in correct state")
	ErrInvalidParamCombination                 = errors.New("cannot request state and published parameters at the same time")
	ErrMethodNotAllowed                        = errors.New("method not allowed")
	ErrPublishedDatasetTopicChange             = errors.New("canonical topic can't be changed once a series is published")
	ErrStateNotFound                           = errors.New("incorrect state, can be one of the following: edition-confirmed, associated, approved or published")

	ErrExpectedResourceStateOfCreated          = errors.New("unable to update resource, expected resource to have a state of created")
	ErrExpectedResourceStateOfSubmitted        = errors.New("unable to update resource, expected resource to have a state of submitted")
	ErrExpectedResourceStateOfCompleted        = errors.New("unable to update resource, expected resource to have a state of completed")
	ErrExpectedResourceStateOfEditionConfirmed = errors.New("unable to update resource, expected resource to have a state of edition-confirmed")
	ErrExpectedResourceStateOfAssociated       = errors.New("unable to update resource, expected resource to have a state of associated")

	NotFoundMap = map[error]bool{
		ErrDatasetNotFound:         true,
		ErrDimensionNotFound:       true,
		ErrDimensionsNotFound:      true,
		ErrDimensionNodeNotFound:   true,
		ErrDimensionOptionNotFound: true,
		ErrEditionNotFound:         true,
		ErrInstanceNotFound:        true,
		ErrVersionNotFound:         true,
		ErrFileMetadataNotFound:    true,
	}

	BadRequestMap = map[error]bool{
		ErrInsertedObservationsInvalidSyntax:  true,
		ErrInvalidBody:                        true,
		ErrInvalidQueryParameter:              true,
		ErrTooManyQueryParameters:             true,
		ErrMissingJobProperties:               true,
		ErrMissingParameters:                  true,
		ErrUnableToParseJSON:                  true,
		ErrUnableToReadMessage:                true,
		ErrTypeMismatch:                       true,
		ErrDatasetTypeInvalid:                 true,
		ErrInvalidVersion:                     true,
		ErrInvalidDatasetTypeForEditionUpdate: true,
		ErrInvalidParamCombination:            true,
		ErrInvalidID:                          true,
	}

	ConflictRequestMap = map[error]bool{
		ErrAddDatasetAlreadyExists:                 true,
		ErrCannotChangeIDForPublishedDataset:       true,
		ErrCannotChangeDatasetIDForMigratedDataset: true,
		ErrCannotChangeEditionIDForMigratedEdition: true,
		ErrConflictUpdatingInstance:                true,
		ErrInstanceConflict:                        true,
		ErrEditionAlreadyExists:                    true,
		ErrEditionTitleAlreadyExists:               true,
		ErrFileNotInCorrectState:                   true,
	}

	ForbiddenMap = map[error]bool{
		ErrExpectedResourceStateOfCreated:          true,
		ErrExpectedResourceStateOfSubmitted:        true,
		ErrExpectedResourceStateOfCompleted:        true,
		ErrExpectedResourceStateOfEditionConfirmed: true,
		ErrExpectedResourceStateOfAssociated:       true,
		ErrResourcePublished:                       true,
		ErrDeletePublishedVersionForbidden:         true,
	}

	NotAllowedMap = map[error]bool{
		ErrMethodNotAllowed: true,
	}
)

A list of error messages for Dataset API

Functions

This section is empty.

Types

type ErrInvalidPatch added in v1.28.0

type ErrInvalidPatch struct {
	Msg string
}

ErrInvalidPatch represents an error due to an invalid HTTP PATCH request

func (ErrInvalidPatch) Error added in v1.28.0

func (e ErrInvalidPatch) Error() string

Jump to

Keyboard shortcuts

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