{"record":{"id":"315f603e634acfcd","repo":"gohugoio/hugo","slug":"process-w","errorCode":null,"errorMessage":"process: %w","messagePattern":"process: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/hugo_sites_build.go","lineNumber":172,"sourceCode":"\n\t\t\t\tif len(events) > 0 || len(conf.WhatChanged.Changes()) > 0 {\n\t\t\t\t\t// Rebuild\n\t\t\t\t\tif err := h.initRebuild(conf); err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"initRebuild: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif err := h.initSites(); err != nil {\n\t\t\t\t\t\treturn fmt.Errorf(\"initSites: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tctx := context.Background()\n\n\t\t\tif err := h.process(ctx, infol, conf, init, events...); err != nil {\n\t\t\t\treturn fmt.Errorf(\"process: %w\", err)\n\t\t\t}\n\t\t\th.reportProgress(func() (state terminal.ProgressState, progress float64) {\n\t\t\t\treturn terminal.ProgressNormal, 0.15\n\t\t\t})\n\t\t\tif err := h.assemble(ctx, infol, conf); err != nil {\n\t\t\t\treturn fmt.Errorf(\"assemble: %w\", err)\n\t\t\t}\n\t\t\th.reportProgress(func() (state terminal.ProgressState, progress float64) {\n\t\t\t\treturn terminal.ProgressNormal, 0.20\n\t\t\t})\n\n\t\t\treturn nil\n\t\t}\n\n\t\tif prepareErr = prepare(); prepareErr != nil {\n\t\t\th.SendError(prepareErr)\n\t\t}\n\t}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/hugo_sites_build.go#L154-L190","documentation":"Wraps a failure of the process() step — the phase that parses sources and creates Page objects (full or partial). The %w is the underlying processing error (template/page/error aggregation).","triggerScenarios":"Raised at hugo_sites_build.go:172 when h.process(ctx, infol, conf, init, events...) errors. This covers reading/parsing content files, handling file events for rebuilds, and the init callback errors.","commonSituations":"A content file with a front matter parse error; a shortcode/templating error during page creation; an init error (initRebuild/initSites) propagated; module import resolution failure while processing.","solutions":["Unwrap %w — it usually carries file/line context for the offending content or template.","Fix the named content file's front matter (YAML/TOML delimiters, unquoted colons).","Fix shortcodes/partials referenced by the failing page.","Run `hugo --verbose` to see which file process() choked on."],"exampleFix":"<!-- before: broken shortcode call in a page -->\n{{< myShortCode missing-arg >}}\n\n<!-- after -->\n{{< myShortCode arg=\"value\" >}}","handlingStrategy":"try-catch","validationCode":"// Lint content front matter + shortcodes before building (e.g. via hugo --renderToMemory dry-run).\nif err := validateContentFrontMatter(contentDir); err != nil { return err }","typeGuard":null,"tryCatchPattern":"if err := h.process(ctx, l, conf, init, events...); err != nil {\n    // process errors usually identify a single file; log and skip vs. abort per policy\n    h.Log.Errorf(\"process failed: %v\", err)\n    return fmt.Errorf(\"process: %w\", err)\n}","preventionTips":["Validate front matter syntax in CI (yaml/toml linters).","Test shortcodes/partials in isolation before content rollout.","Run `hugo --verbose` to surface the offending file quickly."],"tags":["build","content","parsing","pages","hugo"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}