src/main/options-validator.js/validateChoiceOption
function validateChoiceOption(value, choiceInfos) {
  if (!choiceInfos.some(choiceInfo => choiceInfo.value === value)) {
    const choices = choiceInfos
      .filter(choiceInfo => !choiceInfo.deprecated)
      .map(choiceInfo => JSON.stringify(choiceInfo.value))
      .sort();
    const head = choices.slice(0, -2);
    const tail = choices.slice(-2);
    throw new Error(`Expected ${head.concat(tail.join(" or ")).join(", ")}`);
  }
}