Skip to content

Commit

Permalink
Error stack improvements (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat authored Dec 11, 2024
2 parents 231d72a + 1768f1e commit 41dbedc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Errors/EleventyErrorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class EleventyErrorHandler {
while (ref) {
let nextRef = ref.originalError;

// Nunjucks wraps errors and puts the original in error.cause
if (nextRef?.cause?.originalError) {
nextRef = nextRef.cause.originalError;
// Unwrap cause from error and assign it to what Eleventy expects
if (nextRef?.cause) {
nextRef.originalError = nextRef.cause?.originalError ?? nextRef?.cause;
}

if (!nextRef && EleventyErrorUtil.hasEmbeddedError(ref.message)) {
Expand Down

0 comments on commit 41dbedc

Please sign in to comment.