motine / Ohouse

Ohouse
Other
3 stars 2 forks source link

Improve error message if mongodb is not running #27

Open motine opened 10 years ago

motine commented 10 years ago

Catch the exception and give a reasonable error message with what to do to fix it, instead of this:

Traceback (most recent call last):
  File "src/main.py", line 42, in <module>
    main()
  File "src/main.py", line 21, in main
    pm.init(config.PLUGINS_PATH)
  File "/Users/motine/Documents/AMsoil/dev/Ohouse/src/amsoil/core/pluginmanager.py", line 261, in init
    pluginInfo.setup()
  File "/Users/motine/Documents/AMsoil/dev/Ohouse/src/amsoil/core/pluginmanager.py", line 146, in setup
    self._plugin_module.setup()
  File "/Users/motine/Documents/AMsoil/dev/Ohouse/src/plugins/mongodb/plugin.py", line 5, in setup
    mongo_database = MongoDB()
  File "/Users/motine/Documents/AMsoil/dev/Ohouse/src/plugins/mongodb/mongodatabase.py", line 25, in __init__
    client = pymongo.MongoClient()
  File "/Users/motine/.virtualenvs/ohouse/lib/python2.7/site-packages/pymongo/mongo_client.py", line 352, in __init__
    raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 61] Connection refused
motine commented 10 years ago

Also, add info on how to start the mongo server in readme

motine commented 10 years ago

and fix the link to MongoDB in the readme

motine commented 10 years ago

and add the requirement to install mongo (e.g. brew install mongo)