Structuring functions receiving and returning promises?
You're making more work for yourself than necessary. 

Check this out:

var fs = require('fs');
var nodefn = require("when/node/function");

var get_some_data = function(filename) {
  return nodefn.call(fs.readFile, filename);
};

var parse_some_data = function(filename, throwError) {
  return get_some_data(filename).then(function(data) {
      // Mimic a synchronous error
      if (throwError) {
        throw new Error('Error parsing data')
      }

      return JSON.parse(data);
    });
};

var stringify_some_data = function(filename, throwParseError, throwLogError) {
  return parse_some_data(filename, throwParseError).then(function(parsedData) {
    // Mimic a synchronous error
    if (throwLogError) {
      throw new Error('Error stringifying data.');
    }

    return JSON.stringify(parsedData);
  });
};

var onSuccess = function(dataString) {
  console.log('Success! ' + dataString);
};
var onError = function(err) {
  console.log('Error! ' + err.message);
};

// "Success! { "data": "obj" }"
stringify_some_data('./data.json').then(onSuccess, onError);

// "Error! ENOENT, open './not_a_file.json'"
stringify_some_data('./not_a_file.json').then(onSuccess, onError);

// "Error! Error parsing data"
stringify_some_data('./data.json', true).then(onSuccess, onError);

// "Error! Error stringifying data."
stringify_some_data('./data.json', false, true).then(onSuccess, onError);


A couple of things to note:


An error thrown anywhere in the promise chain (synchronous or not) will bubble down to your onError handler
Return values of Promise objects are passed as arguments to the next onSuccess handler


I'm still working on grokking how the Promise/A+ spec works. If you've used jQuery.Deferred, you should know that it does not follow the spec (which made using When.js a big learning curve for me). Here's a pretty decent article explaining the Promise/A+ spec. Brian Cavalier (a When.js author) has some blog posts on asynchronous programming which are worth reading, as well.