Python errors Catcher module for Hawk.
Project description
Python errors Catcher module for Hawk.so.
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
Links
Repository: https://github.com/codex-team/hawk.python
Report a bug: https://github.com/codex-team/hawk.python/issues
PyPI Package: https://pypi.python.org/pypi/hawkcatcher
CodeX Team: https://ifmo.su
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 Distributions
Hashes for hawkcatcher-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2cdf8c183d62e62d9debcccefc9f558acdf4ed008a9091d15353a2bb82d3999 |
|
MD5 | 76474b09192fd30ce804e35546854569 |
|
BLAKE2b-256 | 4ab2937b80c4c9b7f56268df45e9744ce163939fa8fea9c3963709b6e94860f6 |