oaknut-exception
Categorised exceptions and a CLI error-reporting boundary for the
oaknut-* family of packages.
The package defines a small exception hierarchy that every other
oaknut-* package's domain errors slot into:
OaknutException— root of the hierarchy. Carries anexit_codeproperty derived from the BSDsysexits.hset (via theexit-codespackage).DataError— the operation failed because of the data it was given (a user-supplied path, a corrupted on-disc structure, an unsupported filetype). No traceback at the CLI boundary.ConfigurationError— the operation failed because of a runtime environment / configuration issue. No traceback at the CLI boundary.InternalError— the operation failed because something went wrong inside the library. Traceback retained at the CLI boundary so the report-an-issue path is obvious.
Plus a single error-handling boundary helper:
handled_errors— a context manager (also usable as a decorator) that catchesDataErrorandConfigurationError, prints them via a caller-supplied printer, and exits with the most appropriateExitCode.InternalErrorand unexpected exceptions propagate so their tracebacks reach the user.KeyboardInterruptexits with the conventional128 + SIGINTstatus.
This package is what every oaknut-disc-like CLI uses to map library
errors onto stable exit codes without dropping into try/except in every
command.
See the oaknut documentation for the full API reference.
Part of the oaknut monorepo.
Installation
uv add oaknut-exception # or: pip install oaknut-exception
License
MIT — see LICENSE.
Metadata
Release files for oaknut-exception 13.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oaknut_exception-13.3.1.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oaknut_exception-13.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / oaknut_exception-13.3.1.tar.gz
| Download URL | oaknut_exception-13.3.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43e6117b44211f5a04de75e0e3ce9aca0e50e99278c52bf28f549329169965eb
|
|
BLAKE2b-256 checksum How to use checksums |
3accc6a02f7d729ad8c5d3c54cae569ee30daacd17f949e0cd5e76eef262f8ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / oaknut_exception-13.3.1-py3-none-any.whl
| Download URL | oaknut_exception-13.3.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d764547d6c73db016968dfd6876c32e735ce62db6ad018b1f54c5ce3c9f95f31
|
|
BLAKE2b-256 checksum How to use checksums |
c6f8f954c73abe7faa279b6e264b56015bde16030a6a955d766b9a076fca7b3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|