lib/common/index.js
function (error, message, quoteInput) {
    var result, prepend, empty = "", quote = "'";

    if (error) {
      if (message) {
        prepend = quoteInput ? empty.concat(quote, message, quote) : message;
      }

      // Force Error instance, coerce given error to a string
      error = error instanceof Error ? error : new Error(empty + error);

      // If message supplied, prepend it
      error.message =
        prepend ? empty.concat(prepend, ": ", error.message) : error.message;

      result = error;
    }

    return result;
  }
function (error, message, quoteInput) {
    var result, prepend, empty = "", quote = "'";

    if (error) {
      if (message) {
        prepend = quoteInput ? empty.concat(quote, message, quote) : message;
      }

      // Force Error instance, coerce given error to a string
      error = error instanceof Error ? error : new Error(empty + error);

      // If message supplied, prepend it
      error.message =
        prepend ? empty.concat(prepend, ": ", error.message) : error.message;

      result = error;
    }

    return result;
  }
Prepend a message to an Error message.

@param {Object} [error] - An instance of Error. If not, converted to Error.
If undefined, then pass through undefined.
@param {String} [message] - The message to prepend.
@param {Boolean} [quoteInput] - True if the message should be quoted.
@returns {Error} The updated Error instance, undefined if no error.