Error handler added
This commit is contained in:
parent
90256d8ced
commit
7d1e0f3b2e
@ -0,0 +1,24 @@
|
||||
import logging
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
||||
def error(msg: str, exit_: bool = True):
|
||||
"""
|
||||
Handle errors
|
||||
|
||||
Parameters
|
||||
----------
|
||||
msg : str
|
||||
Error message to show
|
||||
exit_ : bool
|
||||
Exit program
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
||||
"""
|
||||
logging.error(msg)
|
||||
if exit_:
|
||||
traceback.print_stack()
|
||||
sys.exit(1)
|
Loading…
Reference in New Issue
Block a user