forked from github/pelican
On failing to load a plugin, show the stacktrace is pelican is run in debug mode
This commit is contained in:
parent
f1f2ceccc7
commit
1f14606f83
1 changed files with 8 additions and 2 deletions
|
|
@ -80,8 +80,14 @@ class Pelican:
|
||||||
plugin.register()
|
plugin.register()
|
||||||
self.plugins.append(plugin)
|
self.plugins.append(plugin)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Cannot register plugin `%s`\n%s", name, e, stacklevel=3)
|
logger.error(
|
||||||
print(e.stacktrace)
|
"Cannot register plugin `%s`\n%s",
|
||||||
|
name,
|
||||||
|
e,
|
||||||
|
stacklevel=2,
|
||||||
|
)
|
||||||
|
if self.settings.get("DEBUG", False):
|
||||||
|
console.print_exception()
|
||||||
|
|
||||||
self.settings["PLUGINS"] = [get_plugin_name(p) for p in self.plugins]
|
self.settings["PLUGINS"] = [get_plugin_name(p) for p in self.plugins]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue