Skip to content
Konjure / spatial intelligence

DataError

← Builtin reference

A stable recoverable error emitted by checked numeric, byte, and tensor operations.

Signature

enum DataError { ... }

Each case name and description comes from the Rust SDK data-error registry.

Cases

TypeMismatch
An operation requires operands with the same declared element type.
InvalidLiteral
Text is not a valid literal of the requested type.
InvalidUtf8
Bytes are not valid UTF-8 where a text value is required.
Overflow
A value or checked integer operation exceeds the destination range.
NonFinite
Infinity and NaN cannot enter a portable data value.
InexactConversion
A conversion would round, truncate, or discard a signed zero.
DivisionByZero
Division or remainder has a zero divisor.
InvalidShape
Shape, rank, or buffer length is not a valid tensor layout.
ShapeMismatch
Shapes cannot participate in the requested operation.
Bounds
An index is outside the requested value.
InvalidSlice
Slice selectors are malformed, including a zero step.
InvalidMetadata
Decoded media metadata disagrees with its payload.
AllocationLimit
A checked allocation exceeds the portable data limit.

Examples

Handle invalid UTF-8

Decoding reports InvalidUtf8 instead of replacing malformed bytes.

Tick 0 · 0.00 s⌘ / Ctrl + EnterThis device
main.kj
Loading the language runtime…
Output 0
No output.
Expected output
InvalidUtf8

Rust definition

konjure_sdk::data::DataError, carried in Res error payloads.

See also