code: function throwIf(val, msg, type) {
    if (!val) {
      switch (type) {
        case 'ex':
          throw Error(errorTitle + 'Extension tag "' + msg + '" is undefined, please check it has been registered.');
  
        default:
          throw Error(errorTitle + (msg || val));
      }
    }
  }
docs: 抛出异常