Throw an exception if ModeParser::AddMode() fails