Skip to main content

The best python exception library!

Project description

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.

Project details


Download files

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

Source Distribution

halerror-0.4.1.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

halerror-0.4.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page