Skip to content

Commit

Permalink
Print a more helpful error if there is not config.py file, #841
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallvord Reiar M. Steen authored and Hallvord R. M. Steen committed Dec 7, 2015
1 parent c9dc1af commit 7608a2f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@
==============================================
'''

NO_CONF_ERROR = '''
==============================================
The config.py file seems to be missing.
Please create a copy of config.py.example and customize it accordingly.
For details, please see
https://github.com/webcompat/webcompat.com/blob/master/CONTRIBUTING.md#configuring-the-server
==============================================
'''

try:
from webcompat import app
except ImportError, e:
raise ImportError('{0}\n\n{1}'.format(e, IMPORT_ERROR))
if e.import_name == 'config':
# config not found, somebody forgot to make a copy of config.py.example and modify?
raise ImportError('{0}\n\n{1}'.format(e, NO_CONF_ERROR))
else:
raise ImportError('{0}\n\n{1}'.format(e, IMPORT_ERROR))


TOKEN_HELP = '''
Expand Down

0 comments on commit 7608a2f

Please sign in to comment.