++ exception handling
This commit is contained in:
parent
1fba79ca31
commit
bff12ed930
3 changed files with 9 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import sys
|
|||
from logging.handlers import SysLogHandler
|
||||
from uncloud.configure.main import configure_parser
|
||||
|
||||
from uncloud import UncloudException
|
||||
|
||||
def exception_hook(exc_type, exc_value, exc_traceback):
|
||||
logging.getLogger(__name__).error(
|
||||
|
|
@ -61,5 +62,7 @@ if __name__ == '__main__':
|
|||
mod = importlib.import_module("uncloud.{}.main".format(name))
|
||||
main = getattr(mod, "main")
|
||||
main(**arguments)
|
||||
except UncloudException as err:
|
||||
logger.error(err)
|
||||
except Exception as err:
|
||||
logger.exception(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue