Catch exceptions via a context manager in Python
Project description
noerr
Catch exceptions via context manager in Python.
Super simple to use:
from noerr import no_err
with no_err:
raise Exception("This won't crash my code!")
print("Yup, still going with no error!")
Also possible to log errors:
from noerr import log_err
with log_err:
raise Exception("Should probably warn the user about this one.")
print("We now see the error, but don't stop because of it")
Outputs:
Exception logged by "LogError"
Traceback (most recent call last):
File "<input>", line 4, in <module>
Exception: Should probably warn the user about this one.
We now see the error, but don't stop because of it
Install
pip install noerr
License
MIT License - Copyright (c) 2020 Chris Griffith - See LICENSE
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
noerr-1.0.0a0.tar.gz
(2.6 kB
view hashes)