Skip to main content

Decorator based error handling for Python, with light Slack coating

Project description

nurgle

https://img.shields.io/pypi/v/nurgle.svg https://img.shields.io/travis/@Herout/nurgle.svg Documentation Status

Decorator based error handling for Python, all props to merry by Miguel Grinberg. This is a naive extension of merry, and should not be used in production. Us on your own risk. Nurgle can be used in batch processing, where you need to be informed of the first run with failure and/or first run that recovered from failure.

Features

For basic information about its use case, please see original README

Nurgle is a drop-in replacement of Merry. On top of parameters provided by Merry, Nurgle object can be constructed as follows:

from nurgle import Nurgle
nurgle = Nurgle(slack_token="<your-slack-token>", slack_channel="<channel-to-write-to>", state_file="/path/to/a-file.nurgle.state")

If decorated code throws an exception

Nurgle looks for state_file in order to determine, if previous run failed as well.

  • If the file does not exist, previous run did not fail, and the exception is sent into the Slack channel.

  • If the file does exist, content is read and compared to stringified current exception. If the exception is not the same, we failed for different reason, and the exception is sent into the Slack channel.

Otherwise, exception is not sent.

If decorated code does not throw an exception

Nurgle looks for state_file in order to determine, if previous run failed or not.

  • If the file does not exist, previous run also did not fail, and nothing is sent to the Slack channel.

  • If the file does exists, previous run failed:
    • “recovery” message is sent to the Slack channel.

    • afterwards, state_file is deleted.

History

0.1.1 (2020-09-08)

  • Docs updates.

0.1.0 (2020-09-08)

  • First release on PyPI.

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

nurgle-0.1.2.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file nurgle-0.1.2.tar.gz.

File metadata

  • Download URL: nurgle-0.1.2.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for nurgle-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f8ceb2c6b045487c022b43c6b57c619e3bff081ba854586427588303e8800d63
MD5 160a98cfa60877ee828819099f1a3a4f
BLAKE2b-256 e6d8169e99c67ed29344d53ac2381e02697ef18aed4e2f5933ae1adfba15fa22

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