Skip to main content

Python package that captures exceptions and notify them

Project description

Capture Errors

A python package that captures the exceptions and notify them via different methods of notification.

This package provides the complete context of the runtime errors which help developers debug the issues and saves time in bug fixing.

Installation

Use the command pip to install the package

$ pip install capture-errors

Environment Setup

$ export CAPTURE_EMAIL_HOST=smtp.gmail.com
$ export CAPTURE_EMAIL_PORT=465
$ export CAPTURE_EMAIL_USER=username@gmail.com
$ export CAPTURE_EMAIL_PASSWORD=securePassxxxx

Usage

from capture import Capture
from capture.adapters.email import EmailAdapter

capture = Capture()
email_adapter_properties = {
    'from_email': '<email-address>',
    'recipients': '<email-address>',
}
capture.set_adapter(EmailAdapter, email_adapter_properties)

try:
    # Code that can generate an error
    # For example: ZeroDivisionError
    x = 10
    y = 500000
    while True:
        remainder = y % x 
        x -= 1
except Exception as ex:
    capture.push(ex)

Available Adapters

  • EmailAdapter

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

capture-errors-0.0.4b0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

capture_errors-0.0.4b0-py3-none-any.whl (9.8 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