code: function getMessages(error) {
      var stackLines = error.stack.split('\n');
      var messageComplete = false;
      var messageLines = [];
  
      for (var i = 0; i < stackLines.length && !messageComplete; i++) {
          var line = stackLines[i];
          if (isMessageLine(line, i)) {
              messageLines.push(line);
          } else {
              messageComplete = true;
          }
      }
  
      return messageLines;
  }
docs: Get the messages part of an error.stack and return these as an array. (The returned array will only contain
  multiple items if the message part consists of multiple lines.)
  
  @method getMessages
  @private
  @param {Error} error the error whose stack messages to provide
  @return {String[]} the messages from the given error stack as an array