fix: surface sanitized operator detail in thothctl compose failures

This commit is contained in:
2026-08-11 19:19:40 +02:00
parent fe49f5b6d8
commit 99d1400ace
@@ -218,6 +218,15 @@ type OperationError struct {
}
func (e *OperationError) Error() string {
detail := strings.TrimSpace(e.detail)
if len(detail) > 0 {
// Bounded, sanitized operator/container detail so operators can diagnose failures
// without leaking secrets; the full renderer sanitizes further before output.
if len(detail) > 2048 {
detail = detail[:2048]
}
return fmt.Sprintf("stage=%s class=%s: %s", e.stage, e.class, detail)
}
return fmt.Sprintf("stage=%s class=%s", e.stage, e.class)
}