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
1 changed files with 3 additions and 1 deletions

View File

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