Skip to main content

halerror

The best python exception library

PyPI PyPI - Python Version Code style: black Documentation Status Travis (.org) Codecov Language grade: Python Total alerts

This python library implements a sci-fi exception class!

Installation

The package is available from PyPI. To install using pip, do the following:

pip install halerror

To install from source, clone this repository and then do the following:

python setup.py install

Testing

To run the tests, clone this repository and the do the following:

python setup.py test

Building the documentation

To build the documenation, clone this repository and the do the following:

pip install -e .[build_sphinx]
python setup.py build_sphinx

Usage examples

The exception class can be used as follows:

from halerror import HalError

def open_pod_bay_doors():
    raise HalError("Open the pod bay doors, HAL.")

open_pod_bay_doors()

This will result in the following error output, where ${NAME} is the username of the person running the software:

halerror.HalError: Open the pod bay doors, HAL

I'm sorry, ${NAME}. I'm afraid I can't do that.

Having all your exceptions formatted like this is as easy as adding the following lines to your code

from halerror import HalError

try:
    open_pod_bay_doors()
except Exception as error:
    raise HalError(error) from error

Documentation

You can find the full documentation on Read the Docs.

Issues

Please use the GitHub issue tracker to submit bugs or request features.

License

Copyright James Parkhurst, 2019.

Distributed under the terms of the BSD license, halerror is free and open source software.

Metadata

Release files for halerror 0.4.1

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

Source distribution (sdist)

Source distribution for halerror 0.4.1
File Size Uploaded
halerror-0.4.1.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for halerror 0.4.1
File Interpreter ABI Platform
halerror-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / halerror-0.4.1.tar.gz

Download URL halerror-0.4.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b5b97a5e05dcbb022c7b884564ac268b83f1232f365cf6747b1ac61f6f156146
BLAKE2b-256 checksum
How to use checksums
297c5302f069275ac3012df79440201dc9951176f97f9841ba0c13413beb8392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release files / halerror-0.4.1-py3-none-any.whl

Download URL halerror-0.4.1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
223aa8fe898cbb406e11f094fe65557fde210aa2144bc5cfbef03c975761f665
BLAKE2b-256 checksum
How to use checksums
4a6fd1acb7b4beae93eac3544fa11c73aacf0f390e46130698b02ef5db320dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.1

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