Skip to main content

oaknut-exception

PyPI version CI Python versions License: MIT

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 an exit_code property derived from the BSD sysexits.h set (via the exit-codes package).
  • 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 catches DataError and ConfigurationError, prints them via a caller-supplied printer, and exits with the most appropriate ExitCode. InternalError and unexpected exceptions propagate so their tracebacks reach the user. KeyboardInterrupt exits with the conventional 128 + SIGINT status.

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 12.18.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oaknut-exception 12.18.2
File Size Uploaded
oaknut_exception-12.18.2.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oaknut-exception 12.18.2
File Interpreter ABI Platform
oaknut_exception-12.18.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.9 kB

Release files / oaknut_exception-12.18.2.tar.gz

Download URL oaknut_exception-12.18.2.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dda96c9adb111ba42a485ca0e8c4934cd5371a12e29576dd110fddd1c348ed8a
BLAKE2b-256 checksum
How to use checksums
7c57e009d3e4c10c0beb3cdfc9e456554026f137cf8de44b0de151063ed889e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","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-12.18.2-py3-none-any.whl

Download URL oaknut_exception-12.18.2-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a33ec84234f952d7b4356b346b6e913872f36ed4061f4f77f8e6333c1100aae3
BLAKE2b-256 checksum
How to use checksums
028e0d80d604d10b99509e903b3a092895e6ca305ccb401066d312b3e72dd983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","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 history Release notifications | RSS feed

13.4.0

2 release files

13.3.1

2 release files

13.1.0

2 release files

13.0.0

2 release files

This release

12.18.2 This release

2 release files

12.9.0

2 release files

12.8.2

2 release files

12.8.1

2 release files

12.8.0

2 release files

12.7.2

2 release files

12.7.1

2 release files

12.7.0

2 release files

12.5.0

2 release files

12.4.1

2 release files

12.4.0

2 release files

12.3.0

2 release files

12.2.0

2 release files

12.1.0

2 release files

12.0.1

2 release files

12.0.0

2 release files

11.2.0

2 release files

11.1.0

2 release files

11.0.2

2 release files

11.0.1

2 release files

11.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page