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 details)

Uploaded Source

Built Distribution

gicd-4.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file gicd-4.0.0.tar.gz.

File metadata

  • Download URL: gicd-4.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for gicd-4.0.0.tar.gz
Algorithm Hash digest
SHA256 fd02d3efccd8dd3bfadf8c4de76fd54ecc715ba12ee60307ab428510914156f3
MD5 4ec11502059645ceae0b72d5a7b6dc36
BLAKE2b-256 3e08550a22145e7d7cdf3e0ee42d602a0aacdc56a339b518b9a1e3001144671a

See more details on using hashes here.

File details

Details for the file gicd-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: gicd-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for gicd-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89dfbebe58aa2a5c92c3d6e72857014690cef4c3daa0d8b1578c22f28137f7da
MD5 e698aa8e6d21d6c41bc7756a194f0896
BLAKE2b-256 4224bf67a8648117df19cc615b94997310d2202465e28dd3f8008cebda5ddbce

See more details on using hashes here.

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