use correct return_code if an error occured

This commit is contained in:
gcarq 2018-03-24 20:56:27 +01:00
parent 4c97ee45dd
commit 3f4261ad1e

View File

@ -41,6 +41,7 @@ def main(sysargv: List[str]) -> None:
)
freqtrade = None
return_code = 1
try:
# Load and validate configuration
configuration = Configuration(args)
@ -54,12 +55,13 @@ def main(sysargv: List[str]) -> None:
except KeyboardInterrupt:
logger.info('SIGINT received, aborting ...')
return_code = 0
except BaseException:
logger.exception('Fatal exception!')
finally:
if freqtrade:
freqtrade.clean()
sys.exit(0)
sys.exit(return_code)
def set_loggers() -> None: