python error class is, to make it simple structure
Project description
smileerror
python error class is, to make it simple structure
# external library
from smileerror.ErrorBase import ErrorBase
# or pypi
# from ErrorBase import ErrorBase
class TestClass:
"""
"""
def __init__(self):
"""
"""
# private
self.error = ErrorBase()
def divideByZero(self, inputData: int) -> float:
"""
"""
self.error.setFalse()
try:
return inputData / 0
exception Exception as e:
self.error.setTrue(message= str(e))
return -1
# render code
test = TestClass()
result = test.divideByZero(22)
if test.error.isTrue():
print(f'Show the messag error please {test.error.getMessage()}')
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
SmileError-1.0.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for SmileError-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5bb732051254786a2a06be708983d91d62dced77b5c889be24dc41459507b17 |
|
MD5 | 5786afb7878ae28758db3d8858af0f4f |
|
BLAKE2b-256 | 97204960fafdfd99552004d3e9889d89ef1facbc46f3c92f195c8a298f0abb91 |