Module:ElementTLDFlair: Difference between revisions

// via Wikitext Extension for VSCode
 
// via Wikitext Extension for VSCode
Line 14: Line 14:
         local errorContext = template._errorContext
         local errorContext = template._errorContext
         -- Protected execution wrapper
         -- Protected execution wrapper
         local function execute(func, ...)
         local execute = function(func, ...)
             if errorContext and errorContext.protect then
             if errorContext and errorContext.protect then
                 return errorContext.protect(
                 return errorContext.protect(
Line 24: Line 24:
                 )
                 )
             else
             else
                 local ok, result = pcall(func, ...)
                 return func(...)
                return ok and result or ""
             end
             end
         end
         end