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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oaknut_exception-12.17.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oaknut_exception-12.17.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file oaknut_exception-12.17.0.tar.gz.

File metadata

  • Download URL: oaknut_exception-12.17.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

File hashes

Hashes for oaknut_exception-12.17.0.tar.gz
Algorithm Hash digest
SHA256 f9e90f7d283cbf5c60423b6fef3a9a9e308c8ee20b9a9530d25eb5d76649f368
MD5 0c58cff851dd6c74ffbeb03d8eebbe3f
BLAKE2b-256 814f342ae69e25fd8ef7061aaadda7a15e52d26bb56cdcfbaa851c255a2c9104

See more details on using hashes here.

File details

Details for the file oaknut_exception-12.17.0-py3-none-any.whl.

File metadata

  • Download URL: oaknut_exception-12.17.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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}

File hashes

Hashes for oaknut_exception-12.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4aa8b05c6a4ab43eea1c7b103a1ae69a99f7b316689c31709059380ea7264136
MD5 e1d66f54638b974b41c2f5e70e73e771
BLAKE2b-256 0e9f9b83733189cd238c4ac3409aec154db4a603aec83b354ad9717b27e08666

See more details on using hashes here.

Release history Release notifications | RSS feed

12.18.0

2 files

12.17.1

2 files

This release

12.17.0 This release

2 files

12.16.0

2 files

12.15.1

2 files

12.15.0

2 files

12.14.1

2 files

12.14.0

2 files

12.13.1

2 files

12.12.0

2 files

12.11.0

2 files

12.10.1

2 files

12.10.0

2 files

12.9.0

2 files

12.8.2

2 files

12.8.1

2 files

12.8.0

2 files

12.7.2

2 files

12.7.1

2 files

12.7.0

2 files

12.6.2

2 files

12.6.1

2 files

12.6.0

2 files

12.5.3

2 files

12.5.2

2 files

12.5.1

2 files

12.5.0

2 files

12.4.1

2 files

12.4.0

2 files

12.3.0

2 files

12.2.0

2 files

12.1.0

2 files

12.0.1

2 files

12.0.0

2 files

11.2.0

2 files

11.1.0

2 files

11.0.2

2 files

11.0.1

2 files

11.0.0

2 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