# Errors

> UForm for C

Statuses are numbered as USearch numbers them, so a failure keeps its identity across the two libraries:

- `uform_status_out_of_memory_k`: host, pinned or device memory ran out, or the scratch ceiling is too low.
- `uform_status_shape_mismatch_k` and `uform_status_unsupported_layout_k`: counts, shapes or strides the model cannot read.
- `uform_status_malformed_k` and `uform_status_io_k`: bytes that do not decode, or a file that does not open, read or write.
- `uform_status_device_k`: the driver refused, a device faulted, or an executor and a model or arena disagree on residency.
- `uform_status_unknown_kind_k`: a scalar, modality or name this build does not know.
- `uform_status_unsupported_k`: a verb, modality or class this model or build does not serve.
- `uform_status_invalid_argument_k` and `uform_status_config_mismatch_k`: an argument breaking the verb's contract, or a request contradicting a frozen configuration.
- `uform_status_contended_k` and `uform_status_cancelled_k`: a call refused rather than waited for, or stopped by its progress handler.
- `uform_status_internal_k`: a defect, reported rather than hung on.

`uform_status_name` spells a status as lowercase words joined by dashes and `uform_status_from_name` reads it back, as the other closed sets' `_name` and `_from_name` pairs do.

`#include <uform/types.h>`

## uform_status_t

What went wrong, numbered as USearch numbers it, so one failure carries one identity across the two libraries and every binding that validates before calling them.

```c
enum uform_status_t
```

Values USearch spends on index states UForm has no counterpart for - a read-only handle, an exhausted ID space, an uninitialized reservation - stay unused here rather than renumbered.

Statuses fall into five categories. Resources: [`uform_status_out_of_memory_k`](#uform_status_out_of_memory_k), [`uform_status_io_k`](#uform_status_io_k) and [`uform_status_device_k`](#uform_status_device_k). Input: [`uform_status_shape_mismatch_k`](#uform_status_shape_mismatch_k), [`uform_status_unsupported_layout_k`](#uform_status_unsupported_layout_k), [`uform_status_unknown_kind_k`](#uform_status_unknown_kind_k), [`uform_status_malformed_k`](#uform_status_malformed_k) and [`uform_status_invalid_argument_k`](#uform_status_invalid_argument_k). State: [`uform_status_config_mismatch_k`](#uform_status_config_mismatch_k), [`uform_status_contended_k`](#uform_status_contended_k) and [`uform_status_unsupported_k`](#uform_status_unsupported_k). Interruptions: [`uform_status_cancelled_k`](#uform_status_cancelled_k) and [`uform_status_deferred_k`](#uform_status_deferred_k). Defects: [`uform_status_internal_k`](#uform_status_internal_k). Any verb that allocates, binds a device or touches a file may also return a Resources status; any verb taking a progress callback may return [`uform_status_cancelled_k`](#uform_status_cancelled_k). A verb's own block lists only what its contract adds.

- `uform_status_success_k` = `0`: The call completed; `message` carries nothing.
- `uform_status_deferred_k` = `1`: The call was submitted deferred and is not final yet; the one non-final status.
- `uform_status_out_of_memory_k` = `2`: Device, pinned, or host memory could not be allocated, or the executor's scratch ceiling is too low.
- `uform_status_shape_mismatch_k` = `3`: Item counts, a pixel shape, or a batch envelope disagree with the call or the model.
- `uform_status_unsupported_layout_k` = `4`: A stride or packing the model cannot read.
- `uform_status_unknown_kind_k` = `5`: A scalar, modality, or name this build does not know.
- `uform_status_io_k` = `7`: A checkpoint file could not be opened, read, or written.
- `uform_status_device_k` = `8`: The driver refused or the device faulted; after a fault the executor refuses every later call.
- `uform_status_malformed_k` = `9`: Supplied bytes could not be decoded: a checkpoint, an image, a clip, or a recording.
- `uform_status_internal_k` = `10`: The library reported neither success nor a failure - a contract violation, so it names a defect.
- `uform_status_config_mismatch_k` = `13`: The request contradicts a frozen configuration, like resuming a checkpoint of another geometry.
- `uform_status_contended_k` = `14`: The call was refused rather than waited for, like a submission to a full deferred table, or a blocking call from inside a callback of the executor it would wait on.
- `uform_status_cancelled_k` = `15`: A progress handler asked the call to stop; it unwound and published nothing.
- `uform_status_unsupported_k` = `16`: The verb is declared for every residency or model, but this one does not implement it, like a modality the model was not trained on; no retry or smaller request can help.
- `uform_status_invalid_argument_k` = `17`: An argument breaks the verb's contract - a required pointer left `NULL`, inputs inside the arena the call rewinds, a name no table spells.

Spellings: ```
char const * uform_status_name(uform_status_t status);
```

```
uform_status_t uform_status_from_name(uform_bytes_view_t name);
```

