ECONNREFUSED when couchdb is offline.

fixed error handling when couchdb is offline. no longer throws up with ECONNREFUSED.