docs: document _load's ValueError-on-non-object-JSON in the error contract (v0.1.1)
README + CLAUDE.md error contract now note that _load raises ValueError on valid-but- non-object JSON (bare list/number/string/null) in addition to JSONDecodeError on a corrupt file, matching the module docstring (L1). Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
parent
e29c523c12
commit
5ee0292dcb
10
README.md
10
README.md
@ -12,13 +12,13 @@ you `delete` or `clear` them.
|
|||||||
`requirements.txt`:
|
`requirements.txt`:
|
||||||
|
|
||||||
```
|
```
|
||||||
aiokv @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiokv.git@v0.1.0
|
aiokv @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiokv.git@v0.1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
Direct:
|
Direct:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install "aiokv @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiokv.git@v0.1.0"
|
pip install "aiokv @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiokv.git@v0.1.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
Requires `aiofiles` (pulled transitively).
|
Requires `aiofiles` (pulled transitively).
|
||||||
@ -77,8 +77,10 @@ are consistent and no update is lost. All blocking filesystem calls run via
|
|||||||
|
|
||||||
## Error contract
|
## Error contract
|
||||||
|
|
||||||
- `get` / `set` / `get_all` raise on unexpected I/O (and `_load` raises on a
|
- `get` / `set` / `get_all` raise on unexpected I/O. `_load` raises `JSONDecodeError`
|
||||||
truncated/corrupt file) so a real failure is visible rather than silently masked.
|
on a truncated/corrupt file, and `ValueError` when the file holds valid JSON that
|
||||||
|
isn't an object (a bare list/number/string/null) — so corruption or a wrong-shaped
|
||||||
|
file is visible rather than silently masked.
|
||||||
- `delete` / `clear` log the exception and return `False` on error, `True` otherwise.
|
- `delete` / `clear` log the exception and return `False` on error, `True` otherwise.
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|||||||
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "aiokv"
|
name = "aiokv"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
description = "Async file-backed key-value store for single-process local state — atomic writes, no TTL, config-free, installable."
|
description = "Async file-backed key-value store for single-process local state — atomic writes, no TTL, config-free, installable."
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user