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@exaple.com'))
def my_function():
assert 1 == 2
# This will send an email to `exaple@exaple.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
Close
Hashes for email_function_failure_traceback-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 212ab60ed27bc0f07c8e1d30cdc7856ad8995452829e26f0914a246d8f7c64c0 |
|
MD5 | 6da37ebe5c72b6cde0997e95e0c098aa |
|
BLAKE2b-256 | 5d6be58f4202a5adbce983538b58a3983b028128887c8443b5f5cef2e905a5f2 |
Close
Hashes for email_function_failure_traceback-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e320f05f3993f06be54ccbf38fc1b907fd02d1d5cb4dd19a2268736e4a353243 |
|
MD5 | d23a8884cdfb40722a6aac88b2ef3e54 |
|
BLAKE2b-256 | 7a4823a837706eae2664b6d65c8fbbbaa7b471088a71bb8caa530b30311a3944 |