title: Node.js Bluebird Promise complains of "Converting circular structure to JSON"
body: <p>For making a outgoing api call, I am using restler wrapped in a bluebird promise object. However, I am getting a <code>Possibly unhandled TypeError: Converting circular structure to JSON</code> at <code>node_modules/bluebird/js/main/promise.js</code>. </p>
  
  <p>This happens even without JSON.stringify. It is happening at the level of promise.js.</p>
  
  <p>What can I do about this?</p>
  
  <pre><code>                rest.postJson(uri, body).then(
                      function(response) {
                          console.log(response.access.token.id);
                          console.log(response.statusCode);
                          res.send(response.access.token.id);
                      }, function(error) {
                          console.log(error.statusCode);
                          res.send(JSON.stringify(error));
                             //res.send(error);
                          }); 
  
  
  
  
  Possibly unhandled TypeError: Converting circular structure to JSON
      at Object.stringify (native)
      at ServerResponse.res.json (/home/one/try/cloudimageshare-monitoring/project/node_modules/express/lib/response.js:205:19)
      at ServerResponse.res.send (/home/one/try/cloudimageshare-monitoring/project/node_modules/express/lib/response.js:121:21)
      at /home/one/try/cloudimageshare-monitoring/project/app/scripts/proxy/proxies_express_module.js:39:29
      at tryCatch1 (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/util.js:43:21)
      at Promise$_callHandler [as _callHandler] (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/promise.js:627:13)
      at Promise$_settlePromiseFromHandler [as _settlePromiseFromHandler] (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/promise.js:641:18)
      at Promise$_settlePromiseAt [as _settlePromiseAt] (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/promise.js:804:14)
      at Promise$_settlePromises [as _settlePromises] (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/promise.js:938:14)
      at Promise$_rejectPromises [as _rejectPromises] (/home/one/try/cloudimageshare-monitoring/project/node_modules/bluebird/js/main/promise.js:931:10)
  </code></pre>
  
  <p><strong>UPDATE</strong>: Here are the keys of the error object if it helps any:</p>
  
  <pre><code>[ '_readableState',
    'readable',
    'domain',
    '_events',
    '_maxListeners',
    'socket',
    'connection',
    'httpVersion',
    'complete',
    'headers',
    'trailers',
    '_pendings',
    '_pendingIndex',
    'url',
    'method',
    'statusCode',
    'client',
    '_consuming',
    '_dumped',
    'httpVersionMajor',
    'httpVersionMinor',
    'upgrade',
    'req',
    'pipe',
    'addListener',
    'on',
    'pause',
    'resume',
    'read',
    'rawEncoded',
    'raw' ]
  </code></pre>