Skip to main content

Python Exception Based Callbacks

Project description

Python Exception Based Callbacks

Add your callbacks to functions as decorators, that are slated to be called as per the Exception raised.

from smoothie.king import Dispenser

def err_callback(*args, **kwargs):
    print("Error handled")

juice = Dispenser()

def vending_machine():
    drinks = ['Tea','Coffee', 'Water']
    return drinks[4]


To run the unit tests,

pip install -r test-requirements.txt
cd smoothie/tests  nosetests -vs``

Project details

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page