Failed Function Error Traceback Email.
Project description
email_function_failure_traceback
This is a decorator for monitoring errors for remote jobs. Wrap your main function in the email_function_failure_traceback
decorator, and if the function fails, an email will be sent based on your configuration that includes the traceback of the error (including SQL errors).
Installation
pip install email_function_failure_traceback
Functions:
email_function_failure_traceback(send_email_function)
Examples:
cache_to_disk
"""
This example caches the function "my_function" for 3 days.
"""
from functools import partial
from email_function_failure_traceback import email_function_failure_traceback
# Implement this yourself using your preferred Email integration...
def send_email(message, subject_line, to_address, from_address):
Email(to_address, from_address, subject_line, message)
@email_function_failure_traceback(
partial(
send_email,
subject_line='my function failed',
to_address='example@example.com',
from_address='example@example.com'))
def my_function():
assert 1 == 2
# This will send an email to `example@example.com` with the error traceback.
my_function()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file email_function_failure_traceback-0.0.2.tar.gz
.
File metadata
- Download URL: email_function_failure_traceback-0.0.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b0a82f8242cfd7f1d45b433f83cbc2913a0e288965e8b761fd1de4bd874bd5 |
|
MD5 | 4c797d76e9298527558064070f7f723a |
|
BLAKE2b-256 | 3656fd0f3c727114015ddb8c73cc15d3f4406eb01e58c7289a30c17297497f33 |
File details
Details for the file email_function_failure_traceback-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: email_function_failure_traceback-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bf249bed2494262202f40243d96bf6c2ca962e62d1bea87d6b9222eab1b57c8 |
|
MD5 | 7a4be42a83fdd2d96052523348bc8001 |
|
BLAKE2b-256 | 3deeea7b90a92ef0811e0f10d1e81caea1e8854fc8a5e04801ee96c1f3e56d65 |