From 152c4483c86673395fca5dcce8ee3f08d69fa420 Mon Sep 17 00:00:00 2001 From: Gerald Lonlas Date: Sun, 4 Mar 2018 20:22:40 -0800 Subject: [PATCH] Configuration() sends a msg to user when config file not found --- freqtrade/configuration.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/freqtrade/configuration.py b/freqtrade/configuration.py index c68b06dc1..fd9872eb3 100644 --- a/freqtrade/configuration.py +++ b/freqtrade/configuration.py @@ -51,8 +51,15 @@ class Configuration(object): :param path: path as str :return: configuration as dictionary """ - with open(path) as file: - conf = json.load(file) + try: + with open(path) as file: + conf = json.load(file) + except FileNotFoundError: + self.logger.critical( + 'Config file "%s" not found. Please create your config file', + path + ) + exit(0) if 'internals' not in conf: conf['internals'] = {}