Skip to content

Commit

Permalink
On failing to load a plugin, show the stacktrace is pelican is run in…
Browse files Browse the repository at this point in the history
… debug mode
  • Loading branch information
MinchinWeb committed Jan 27, 2024
1 parent f1f2cec commit 1f14606
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pelican/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ def init_plugins(self):
plugin.register()
self.plugins.append(plugin)
except Exception as e:
logger.error("Cannot register plugin `%s`\n%s", name, e, stacklevel=3)
print(e.stacktrace)
logger.error(
"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]

Expand Down

0 comments on commit 1f14606

Please sign in to comment.