pub enum Error {
Show 25 variants
BadComponent(Error),
BadCoordinate,
BadDepth,
BadFilename,
BadFillCharacter,
BadInventorySlot,
BadItem,
BadPaletteIndex,
BadScreen,
Blocked(BlockContent),
ChecksumMismatch,
DataTooLarge,
FileNotFound,
ImpossibleMove,
InventoryFull,
NegativeSeek,
NoItem,
NoInventory,
NotEnoughEnergy,
StorageReadOnly,
TooManyDescriptors,
TooManyOpenPorts,
TooManyParts,
Unsupported,
Failed,
}
Expand description
The errors that a component call can return.
Variants§
BadComponent(Error)
The call was addressed to a component that does not exist, is not accessible, or is of the wrong type.
The underlying syscall error is encapsulated.
BadCoordinate
An unsupported screen resolution, viewport size, or screen coordinate was requested.
BadDepth
An unsupported colour depth was requested.
BadFilename
The filename passed to a function is structurally invalid to be a filename.
BadFillCharacter
The character to use to fill the screen lies outside the basic multilingual plane and therefore cannot be used for filling.
BadInventorySlot
An index number is outside the range of slots for an inventory or tanks for a fluid-containing block.
In the case of item inventories, this is only returned if the block is in fact an
inventory; NoInventory
is returned for non-inventories. In the case
of fluid containers, this is also returned if the block is not a fluid container at all (it
is treated as a fluid container with zero tanks), but not if the block is in an unloaded
chunk.
BadItem
An item is not usable for the requested purpose.
For example, an item that does not hold fluid cannot have its fluid level or capacity queried.
BadPaletteIndex
A set-colour request tried to set a colour by palette index, and the palette index was unacceptable. This could be because the palette index was outside the range of the palette for the current bit depth, or it could be because the current bit depth does not support a palette at all.
BadScreen
The address specified when binding a GPU does not exist, is inaccessible, or is not a screen; or, a GPU operation which requires a screen was executed when the GPU is unbound or the screen to which it was bound has been disconnected.
Blocked(BlockContent)
The robot cannot move because there is something in the way.
ChecksumMismatch
The checksum passed when trying to make an EEPROM read-only does not match the checksum of the contents of the EEPROM.
DataTooLarge
The data (e.g. to write to a file or EEPROM or send over a communication interface) is too large.
FileNotFound
The named file or directory does not exist.
ImpossibleMove
The robot tried to move to a position that is too far away from support (and does not have a suitable hover upgrade to allow such movement), tried to move into an unloaded chunk, or the destination is otherwise unsuitable for a reason other than there being something in the way.
InventoryFull
An attempt was made to move an item or fluid into an inventory slot or tank, but it could not be inserted because the slot or tank is full, or the existing contents are not compatible with the new addition.
NegativeSeek
A seek in a file would place the file pointer at a negative position.
NoItem
There is no item in an inventory slot when one is required.
NoInventory
There is no inventory in the specified location. This includes if the inventory is in an unloaded chunk.
This is also returned when attempting to access a fluid tank in an unloaded chunk, but not
when attempting to access a fluid tank in a block that does not contain any tanks; in the
latter case, BadInventorySlot
is used instead.
NotEnoughEnergy
The computer does not have enough energy to perform the operation.
StorageReadOnly
The storage (e.g. EEPROM or filesystem) cannot be written to because it is read-only.
TooManyDescriptors
There are too many open descriptors.
TooManyOpenPorts
There are too many listening network ports.
TooManyParts
There are too many parts in a packet.
Unsupported
The operation is not supported for this component.
For example:
- An attempt was made to set a filesystem’s label, but this particular filesystem does not support labels.
- An attempt was made to access item stack information in an inventory, but detailed item information access is disabled in the configuration file.
Failed
The operation failed but no more detailed information is available at the type level. The individual method may document more specific reasons for this error to appear.