Nowadays we don't have .errno anymore ?

This commit is contained in:
Alexandre Aubin 2019-08-20 00:45:05 +02:00
parent 3878ffdc04
commit 83d9e772e7

View file

@ -98,7 +98,7 @@ def api(namespaces, host='localhost', port=80, routes={},
except MoulinetteError as e:
import logging
logging.getLogger(namespaces[0]).error(e.strerror)
return e.errno
return e.errno if hasattr(e, "errno") else 1
except KeyboardInterrupt:
import logging
logging.getLogger(namespaces[0]).info(m18n.g('operation_interrupted'))