Jekyll Plugin Error Handling During Build
0 reputation · 30 Mar 2024, 17:20 UTC
0 reputation · 30 Mar 2024, 17:20 UTC
Jekyll catches exceptions originating from plugins during the site generation phase.
The default behavior allows the build to continue even after a plugin exception is logged.
Does Jekyll inherently fail the entire build when a plugin throws an exception, or does it proceed with a potentially incomplete site?
Jekyll does not emit a completed site when an uncaught plugin exception occurs during generation. By default, the build stops and the Jekyll CLI exits with a non-zero status. The build can proceed with a potentially incomplete site only if the plugin catches the exception itself or a hook swallows it; Jekyll cannot detect internally handled errors and may finish while missing pages or assets.
| Item | Status | Details |
|---|---|---|
| Uncaught plugin exception | Confirmed | Aborts generation; non-zero exit; no success message. |
| Configuration directive to force failure | Confirmed absence | No _config.yml directive enforces failure; failure is the default for uncaught exceptions. |
strict_front_matter | Confirmed unrelated | Controls invalid YAML front matter, not uncaught plugin exceptions. |
--trace | Confirmed | Prints full backtraces and re-raises in CLI error paths; does not create a continue-on-error mode and is not, by itself, proof that the build halted. |
| Plugin catches its own error | Likely explanation | Accounts for reports that the build continues after a plugin error is logged. |
| Version and plugin-type variance | Uncertain | Behavior may differ by Jekyll version and by whether the exception is raised in a generator, converter, hook, tag, or during plugin loading. |
jekyll -vjekyll build
echo $?jekyll build --trace and compare the backtrace. Trace shows propagation but does not by itself prove the build stopped.Missing diagnostic detail: which Jekyll version are you running? Version-specific handling can change whether a workaround is needed. Verify this behavior against your installed version before relying on it in CI.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.