Skip to main content

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


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 details)

Uploaded Source

Built Distribution

noerr-1.0.0a0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file noerr-1.0.0a0.tar.gz.

File metadata

  • Download URL: noerr-1.0.0a0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.8.0 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for noerr-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 71441ef2e8a8a97987e8cb47639f83a6a1c0154bb5cf690f2dab77684d7c39cc
MD5 9b141e2edafc8f9b903891951c475ab6
BLAKE2b-256 21442fba04cccad5d96996baa3394a9700f8bd77208b50dd1111746a20ae9dfc

See more details on using hashes here.

File details

Details for the file noerr-1.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: noerr-1.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.8.0 tqdm/4.47.0 CPython/3.6.8

File hashes

Hashes for noerr-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 6916390b048458d91b3325b698fec727853f05c7cf7ad8632347f76608e2ed2f
MD5 8c2a041f9cfc1693c87979b5cab9fd22
BLAKE2b-256 cf72cc7911a90e5b963224ea52a413faf3ec1b466bdfa5a810b03c45eed28840

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page