felixge/node-couchdb — Issue #35: Basic Example from Readme trhowing errors from promise lib 
Author: sebs
Created: 2012-01-01 17:58:38+00:00
State: open

rinzler:node sebs$ node test.js

/Users/sebs/projects/discogsimport/node/node_modules/couchdb/node_modules/promised-io/lib/promise.js:215
throw error;
^
[object Object]
rinzler:node sebs$

I am using the latest couchbase the latest module from npm. I have several issues with that.

1. There seems to be a mistake in error handling inside the NPM module: As a couchbase user I am not willing to debug errors in promises. I am not even capable of it.

2. This is a basic example, and IF couchbase single IS a valid db for this module, I expect as a minimum the example from the readme to work.

my script

var
sys = require('util'),
couchdb = require('couchdb'),
client = couchdb.createClient(5984, 'localhost'),
db = client.db('releases');

db
.saveDoc('my-doc', {awesome: 'couch fun'}, function(er, ok) {
if (er) throw new Error(JSON.stringify(er));
sys.puts('Saved my first doc to the couch!');
});

releases DB exist, db is writable from futon without permission stuff