plugin(fix): catch plugin crash at init time
This commit is contained in:
1 parent
16192d2354
commit
fd862f5e28
3 files changed
+31
-10
No files matched your search
@@ -319,14 +319,20 @@ function ReaderUI:init()
|
||||
ui = self,
|
||||
})
|
||||
-- koreader plugins
|
||||
for _,plugin_module in ipairs(PluginLoader:loadPlugins()) do
|
||||
logger.info("RD loaded plugin", plugin_module.name, "at", plugin_module.path)
|
||||
self:registerModule(plugin_module.name, plugin_module:new{
|
||||
dialog = self.dialog,
|
||||
view = self.view,
|
||||
ui = self,
|
||||
document = self.document,
|
||||
})
|
||||
for _, plugin_module in ipairs(PluginLoader:loadPlugins()) do
|
||||
local ok, plugin_or_err = PluginLoader:createPluginInstance(
|
||||
plugin_module,
|
||||
{
|
||||
dialog = self.dialog,
|
||||
view = self.view,
|
||||
ui = self,
|
||||
document = self.document,
|
||||
})
|
||||
if ok then
|
||||
self:registerModule(plugin_module.name, plugin_or_err)
|
||||
logger.info("RD loaded plugin", plugin_module.name,
|
||||
"at", plugin_module.path)
|
||||
end
|
||||
end
|
||||
|
||||
-- we only read settings after all the widgets are initialized
|
||||
|
||||
Reference in new issue
Block a user