lib/serializers.js
function getFullErrorStack(ex) {
  var ret = ex.stack;
  if(ex.cause && typeof(ex.cause) === 'function') {
    var cex = ex.cause();
    if(cex) {
      ret += '\nCaused by: ' + getFullErrorStack(cex);
    }
  }
  return ret;
}
function getFullErrorStack(ex) {
  var ret = ex.stack;
  if(ex.cause && typeof(ex.cause) === 'function') {
    var cex = ex.cause();
    if(cex) {
      ret += '\nCaused by: ' + getFullErrorStack(cex);
    }
  }
  return ret;
}
Dumps long stack traces for exceptions having a cause() method.

@param ex The exception.

@return A string representation of the error stack.