Skip to main content

Python decorator that will automatcially create a GitHub Issue if a decorated function throws an exception

Project description

gicd

gicd contains a Python function that provides a decorator that will automatcially create an issue on GitHub if a decorated function throws an exception. That's it!

Requirements

  • The GitHub CLI (gh)

Usage

Decorate a function with it:

from gicd import gicd

@gicd("zmarffy", "test-repo", issue_label="explosion", exception_types=[IndexError, ValueError])
def error_prone_function():
    if input("Don't type anything; just hit enter... "):
        raise ValueError("Explosions!")
    print("All good!")

Then call the function:

error_prone_function()

In the off chance that the function raises an exception, it will create an issue in the GitHub repo specified in the decorator. You can have the decorator do this with all exceptions (default behavior), or, if you specify the exception_types parameter, it will only create an issue when exceptions of those types are thrown.

This is mostly a joke package. It was my first library I ever wrote.

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

gicd-4.0.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

gicd-4.0.0-py3-none-any.whl (3.3 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