diff --git a/frappe/__init__.py b/frappe/__init__.py index e1fe790b45..554f1f9747 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -10,7 +10,7 @@ from six import iteritems, binary_type, text_type, string_types, PY2 from werkzeug.local import Local, release_local import os, sys, importlib, inspect, json from past.builtins import cmp - +import click from faker import Faker # public @@ -226,12 +226,20 @@ def get_site_config(sites_path=None, site_path=None): if sites_path: common_site_config = os.path.join(sites_path, "common_site_config.json") if os.path.exists(common_site_config): - config.update(get_file_json(common_site_config)) + try: + config.update(get_file_json(common_site_config)) + except Exception as error: + click.secho("common_site_config.json is invalid", fg="red") + print(error) if site_path: site_config = os.path.join(site_path, "site_config.json") if os.path.exists(site_config): - config.update(get_file_json(site_config)) + try: + config.update(get_file_json(site_config)) + except Exception as error: + click.secho("{0}/site_config.json is invalid".format(local.site), fg="red") + print(error) elif local.site and not local.flags.new_site: raise IncorrectSitePath("{0} does not exist".format(local.site))