Skip to main content

Python Trace Error

Project description

upy-error

GitHub Org's stars PyPI - Python Version PyPI GitHub last commit



How to install?

pip install upy-error

How to use?

# Import the package
from upy_error import format_exception

Exception example with (log)

try:
    print(x)
except Exception as error:
    # Using the function to process the error with the 'logging' package.
    format_exception(error=error, log=True)

Output:

==========================================
2022-07-23 00:13:37,577 ERROR 
UpyError: 
  File "test_upy_error.py", line 4, in <module>
    print(x)
NameError: name 'x' is not defined
==========================================

Exception example with (print)

try:
    1 / 0
except Exception as error:
    # Using the function to return the error in string format.
    print(format_exception(error=error))

Output:

UpyError: 
  File "test_upy_error.py", line 11, in <module>
    1 / 0
ZeroDivisionError: division by zero

Commit Style

  • ⚙️ FEATURE
  • 📝 PEP8
  • 📌 ISSUE
  • 🪲 BUG
  • 📘 DOCS
  • 📦 PyPI
  • ❤️️ TEST
  • ⬆️ CI/CD
  • ⚠️ SECURITY

License

Distributed under the MIT License. See LICENSE for more information.

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

upy-error-0.0.3.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

upy_error-0.0.3-py2.py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 2 Python 3

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