Skip to main content

Python errors Catcher module for Hawk.

Project description

Python errors Catcher module for Hawk.so.

https://capella.pics/20896900-5bcf-4383-a38a-c732689f71f0

Usage

Register an account and get a new project token.

Install module

Install hawkcatcher from PyPI.

$ pip install hawkcatcher

Import Catcher module to your project.

from hawkcatcher import Hawk

Then enable Hawk Catcher with your token and domain.

hawk = Hawk({
    'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOiI1ZTZmNWM3NzAzOWI0MDAwMjNmZDViODAiLCJpYXQiOjE1ODQzNTY0NzF9.t-5Gelx3MgHVBrxTsoMyPQAdQ6ufVbPsts9zZLW3gM8',
    'host': 'localhost:3000',
    'path': '/',
    'secure': False,
})

Now all global errors would be sent to Hawk.

Try-except

If you want to catch errors in try-except blocks then use hawk.catch() in except:

try:
    ...
except:
    hawk.catch()

Init params

To init Hawk Catcher just pass a project token.

hawk = Hawk('1234567-abcd-8901-efgh-123456789012')

Additional params

If you need to use custom Hawk server then pass a dictionary with params.

hawk = Hawk({
    'token': '1234567-abcd-8901-efgh-123456789012',
    'host': 'hawk.so',
    'secure': True,
})

Requirements

  • Python >= 3.5
  • requests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for hawkcatcher, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size hawkcatcher-2.0.0-py3.7.egg (6.0 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size hawkcatcher-2.0.0-py3-none-any.whl (4.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size hawkcatcher-2.0.0.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

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