@@ -358,17 +358,23 @@ local function fetchSinglePluginNoFallbacks(dstDir, plugin, pluginTable, pluginP
358
358
local ok = false
359
359
for i = 1 ,# pluginLocators do
360
360
local locator = pluginLocators [i ]
361
- local result
361
+ local success , result
362
362
if type (locator ) == ' table' then
363
363
if not locator .initialized and type (locator .init ) == ' function' then
364
- locator :init (params )
364
+ success , result = pcall (locator .init , locator , params )
365
+ if not success then
366
+ print (" WARNING: error initializing plugin locator " .. (locatorName (locator ) or " <unknown>" ) .. " : " .. tostring (result ))
367
+ end
365
368
locator .initialized = true
366
369
end
367
- result = locator : collect ( pluginDestination , plugin , pluginTable , pluginPlatform , params )
370
+ success , result = pcall ( locator . collect , locator , pluginDestination , plugin , pluginTable , pluginPlatform , params )
368
371
else
369
- result = locator (pluginDestination , plugin , pluginTable , pluginPlatform , params )
372
+ success , result = pcall (locator , pluginDestination , plugin , pluginTable , pluginPlatform , params )
373
+ end
374
+ if not success then
375
+ print (" WARNING: runtime error while executing plugin locator " .. (locatorName (locator ) or " <unknown>" ) .. " : " .. tostring (result ))
370
376
end
371
- if result == true then
377
+ if success and result == true then
372
378
log (" Located " .. plugin .. " with locator " .. (locatorName (locator ) or " <unknown>" ))
373
379
ok = true
374
380
break
@@ -462,8 +468,8 @@ local function CollectCoronaPlugins(params)
462
468
local pluginPlatform = params .pluginPlatform
463
469
local collectedPlugins = {}
464
470
for plugin , pluginTable in pairs (plugins ) do
465
- assert ( type (plugin ) == ' string' , " Plugin is not a string" )
466
- assert ( type (pluginTable ) == ' table' , ' Invalid plugin table for ' .. plugin )
471
+ if type (plugin ) ~= ' string' then return " Plugin is not a string" end
472
+ if type (pluginTable ) ~= ' table' then return ' Invalid plugin table for ' .. plugin end
467
473
local result = fetchSinglePlugin (dstDir , plugin , pluginTable , pluginPlatform , params , pluginLocators )
468
474
if type (result ) == ' string' then
469
475
if params .continueOnError then
0 commit comments