Skip to content

Commit

Permalink
Merge pull request #842 from webcompat/noconfighelp
Browse files Browse the repository at this point in the history
Print a more helpful error if there is no config.py file. Fixes #841
  • Loading branch information
Mike Taylor committed Dec 7, 2015
2 parents ffde5e0 + 7608a2f commit 3e1a942
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 3e1a942

Please sign in to comment.