code: function captureStackTrace(error, constructor) {
      if (Error.captureStackTrace) {
          Error.captureStackTrace(error, constructor);
      } else {
          error.stack = new Error().stack;
      }
  }
docs: Error.captureStackTrace is not available in all
  environments, so this function wraps an alternative
  
  @param {*} error
  @param {*} constructor