Skip to content

Display friendlier error when CouchDB is not running #69

Open
gradus opened this Issue May 3, 2012 · 3 comments

2 participants

@gradus
gradus commented May 3, 2012

probably no way around this, but maybe should be documented somewhere if not already.

When running the test suite without Couch running you get an obvious failure

  ♢ resourceful/engines/couchdb 

  In database "test" Defining resource "book"
    ✓ will be successful
  In database "test" Defining resource "author"
    ✓ will be successful
  In database "test" an Resource.all() request

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
    ✗ should respond with an array of all records 
        » expected null, got { 
      errno: 'ECONNREFUSED', 
      message: 'connect ECONNREFUSED', 
      syscall: 'connect', 
      stack: 'Error: connect ECONNREFUSED\n    at errnoException (net.js:670:11)\n    at Object.afterConnect [as oncomplete] (net.js:661:19)', 
      arguments: undefined, 
      type: undefined, 
      code: 'ECONNREFUSED' 
  } // net.js:670
TypeError: Cannot read property 'status' of undefined
    at Object.callback (/Users/klop/node/resourceful/lib/resourceful/engines/couchdb/index.js:53:27)
    at /Users/klop/node/resourceful/node_modules/cradle/lib/cradle/database/documents.js:45:18
    at Request._callback (/Users/klop/node/resourceful/node_modules/cradle/lib/cradle.js:181:18)
    at /Users/klop/node/resourceful/node_modules/cradle/node_modules/request/main.js:119:22
    at Request.<anonymous> (native)
    at Request.<anonymous> (events.js:67:17)
    at Request.emit (/Users/klop/node/resourceful/node_modules/vows/lib/vows.js:236:24)
    at ClientRequest.<anonymous> (/Users/klop/node/resourceful/node_modules/cradle/node_modules/request/main.js:207:10)
    at ClientRequest.<anonymous> (events.js:67:17)
    at ClientRequest.emit (/Users/klop/node/resourceful/node_modules/vows/lib/vows.js:236:24)
@indexzero
a decoupled application framework member

Do you have CouchDB running?

@gradus
gradus commented May 10, 2012

I usually do just keep it running b/c we use it a lot.
Hence all tests usually pass, but I did run without CouchDB and got the above error.
Like I said, there is probably no way around this, but I wanted to bring it up, b/c it always sucks to have to depend on having something else running to have your tests pass.
I had a hard drive failure yesterday and haven't yet gotten back into re-installing some things, so I am knee deep in getting my system back together at the moment.

@indexzero
a decoupled application framework member

lol Next time I should read your entire comment instead of just the screen dump.

Yeah. I'll leave this open as a reminder to kindly inform people they need CouchDB running. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.