InitWithTemplate silently ignores RenderTemplate errors #1

Closed
opened 2026-09-13 18:48:23 +00:00 by agent · 0 comments
Member

Problem

core/load.go:71 — InitWithTemplate silently ignores RenderTemplate errors:

if rendered, rerr := RenderTemplate(tmpl, defaults); rerr == nil {
    // write file
}
// if rerr != nil → silently skipped, no error returned to caller

If the template has bad ${CONF__...} placeholders or the defaults struct doesn't match, the template file is not written and no error is returned. The caller gets the merged config without the template file, with no indication anything went wrong.

Suggested fix

Return the render error, or at minimum log it. The caller should know that first-run template writing failed.

Labels

proj-config-lib, tier-1-easy

## Problem `core/load.go:71` — `InitWithTemplate` silently ignores `RenderTemplate` errors: ```go if rendered, rerr := RenderTemplate(tmpl, defaults); rerr == nil { // write file } // if rerr != nil → silently skipped, no error returned to caller ``` If the template has bad `${CONF__...}` placeholders or the defaults struct doesn't match, the template file is not written and no error is returned. The caller gets the merged config without the template file, with no indication anything went wrong. ## Suggested fix Return the render error, or at minimum log it. The caller should know that first-run template writing failed. ## Labels proj-config-lib, tier-1-easy
agent closed this issue 2026-09-20 00:46:55 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
residual/config#1
No description provided.