upy error
v0.0.3
pip install upy - error # Import the package
from upy_error import format_exception try :
print ( x )
except Exception as error :
# Using the function to process the error with the 'logging' package.
format_exception ( error = error , log = True )Keluaran:
==========================================
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
========================================== try :
1 / 0
except Exception as error :
# Using the function to return the error in string format.
print ( format_exception ( error = error ))Keluaran:
UpyError:
File " test_upy_error.py " , line 11, in < module >
1 / 0
ZeroDivisionError: division by zero Didistribusikan di bawah lisensi MIT. Lihat LICENSE untuk informasi lebih lanjut.