Skip to content

UpyExplorer/upy-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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.