github.com/thy00/storage@v1.12.8/errors.go (about) 1 package storage 2 3 import ( 4 "errors" 5 ) 6 7 var ( 8 // ErrContainerUnknown indicates that there was no container with the specified name or ID. 9 ErrContainerUnknown = errors.New("container not known") 10 // ErrImageUnknown indicates that there was no image with the specified name or ID. 11 ErrImageUnknown = errors.New("image not known") 12 // ErrParentUnknown indicates that we didn't record the ID of the parent of the specified layer. 13 ErrParentUnknown = errors.New("parent of layer not known") 14 // ErrLayerUnknown indicates that there was no layer with the specified name or ID. 15 ErrLayerUnknown = errors.New("layer not known") 16 // ErrLoadError indicates that there was an initialization error. 17 ErrLoadError = errors.New("error loading storage metadata") 18 // ErrDuplicateID indicates that an ID which is to be assigned to a new item is already being used. 19 ErrDuplicateID = errors.New("that ID is already in use") 20 // ErrDuplicateName indicates that a name which is to be assigned to a new item is already being used. 21 ErrDuplicateName = errors.New("that name is already in use") 22 // ErrParentIsContainer is returned when a caller attempts to create a layer as a child of a container's layer. 23 ErrParentIsContainer = errors.New("would-be parent layer is a container") 24 // ErrNotAContainer is returned when the caller attempts to delete a container that isn't a container. 25 ErrNotAContainer = errors.New("identifier is not a container") 26 // ErrNotAnImage is returned when the caller attempts to delete an image that isn't an image. 27 ErrNotAnImage = errors.New("identifier is not an image") 28 // ErrNotALayer is returned when the caller attempts to delete a layer that isn't a layer. 29 ErrNotALayer = errors.New("identifier is not a layer") 30 // ErrNotAnID is returned when the caller attempts to read or write metadata from an item that doesn't exist. 31 ErrNotAnID = errors.New("identifier is not a layer, image, or container") 32 // ErrLayerHasChildren is returned when the caller attempts to delete a layer that has children. 33 ErrLayerHasChildren = errors.New("layer has children") 34 // ErrLayerUsedByImage is returned when the caller attempts to delete a layer that is an image's top layer. 35 ErrLayerUsedByImage = errors.New("layer is in use by an image") 36 // ErrLayerUsedByContainer is returned when the caller attempts to delete a layer that is a container's layer. 37 ErrLayerUsedByContainer = errors.New("layer is in use by a container") 38 // ErrImageUsedByContainer is returned when the caller attempts to delete an image that is a container's image. 39 ErrImageUsedByContainer = errors.New("image is in use by a container") 40 // ErrIncompleteOptions is returned when the caller attempts to initialize a Store without providing required information. 41 ErrIncompleteOptions = errors.New("missing necessary StoreOptions") 42 // ErrSizeUnknown is returned when the caller asks for the size of a big data item, but the Store couldn't determine the answer. 43 ErrSizeUnknown = errors.New("size is not known") 44 // ErrStoreIsReadOnly is returned when the caller makes a call to a read-only store that would require modifying its contents. 45 ErrStoreIsReadOnly = errors.New("called a write method on a read-only store") 46 // ErrDuplicateImageNames indicates that the read-only store uses the same name for multiple images. 47 ErrDuplicateImageNames = errors.New("read-only image store assigns the same name to multiple images") 48 // ErrDuplicateLayerNames indicates that the read-only store uses the same name for multiple layers. 49 ErrDuplicateLayerNames = errors.New("read-only layer store assigns the same name to multiple layers") 50 // ErrInvalidBigDataName indicates that the name for a big data item is not acceptable; it may be empty. 51 ErrInvalidBigDataName = errors.New("not a valid name for a big data item") 52 // ErrDigestUnknown indicates that we were unable to compute the digest of a specified item. 53 ErrDigestUnknown = errors.New("could not compute digest of item") 54 // ErrLayerNotMounted is returned when the requested information can only be computed for a mounted layer, and the layer is not mounted. 55 ErrLayerNotMounted = errors.New("layer is not mounted") 56 )