Module:CountryData: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
Line 610: Line 610:
-- Get semantic properties for countries and regions
-- Get semantic properties for countries and regions
-- Returns a table of properties that can be integrated with the batch processing system
-- Returns a table of properties that can be integrated with the batch processing system
function CountryData.getSemanticCountryRegionProperties(countryValue)
function CountryData.getSemanticCountryRegionProperties(countryValue, errorContext)
     -- Initialize return table
     -- Initialize return table
     local properties = {}
     local properties = {}
Line 633: Line 633:
     -- Debug: Track country normalization flow
     -- Debug: Track country normalization flow
     local ErrorHandling = require('Module:ErrorHandling')
     local ErrorHandling = require('Module:ErrorHandling')
     local debugContext = ErrorHandling.createContext("CountryData")
     local debugContext = errorContext or ErrorHandling.createContext("CountryData")
     ErrorHandling.addError(debugContext, "CountryDebug",  
     ErrorHandling.addError(debugContext, "CountryDebug",  
         string.format("Input='%s' Countries=%d FirstCountry='%s'",  
         string.format("Input='%s' Countries=%d FirstCountry='%s'",