v0.253.0 — errors carry the key of the sentence they are (R-557 slice 2 release B)
gates / gates (push) Successful in 24s
gates / gates (push) Successful in 24s
179 Hungarian sentences were built deep inside a package with fmt.Errorf and printed by whoever caught them: too late to translate where they are shown, too early where they are made. Every one now carries its key across that gap. ZERO Hungarian error literals remain. util.MsgError does three things at once, each earned: - Error() is the Hungarian, byte for byte, so every un-converted printer is unchanged; - errors.Is answers for the kind AND for a wrapped cause (KindErrorf dropped the cause); - an error ARGUMENT renders recursively, so "formázás sikertelen: %w" translates whole. A foreign error — restic, docker, ssh, the stdlib — prints verbatim. It is not ours. 76 display sites go through errText, and TestNoErrErrorInPageOutput convicts any that do not. memoryVerdict returns an error rather than a sentence, so the deploy's 409 and the household's language come from one value; UpdateRefusal gained a Cause to carry it. Plurals, one rule, stated once: a key with .one/.other takes its COUNT first. Not a per-call-site flag — the producer somebody forgot would read "3 app is not running". The guard caught a real key collision (alert.deadapp.one) the day the rule landed. TWO DEFECTS FOUND IN MY OWN TOOLING, recorded rather than quietly fixed. The bulk converter silently dropped multi-line concatenations, damaging 7 producers — and the parity gate could not see it, because every surviving fragment WAS a real base literal while the CALL had lost text; two behaviour tests caught it. And the counting script was case-sensitive, so it said "0 left" while five remained. MinAgent: 0.131.0 (unchanged). No hub release needed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/util"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
@@ -219,7 +220,7 @@ func (u *Updater) registryBaseURL() string {
|
||||
func (u *Updater) queryRegistry() (string, error) {
|
||||
anonymous := u.RegistryAnonymous()
|
||||
if !anonymous && (u.gitCfg.Username == "" || u.gitCfg.Token == "") {
|
||||
return "", fmt.Errorf("hiányos registry hitelesítő adatok (felhasználónév és token együtt szükséges)")
|
||||
return "", util.MsgError("err.selfupdate.hianyos_registry_hitelesito_adatok_felhasznalonev_es")
|
||||
}
|
||||
|
||||
// Registry V2: GET /v2/<owner>/<repo>/tags/list
|
||||
@@ -498,26 +499,26 @@ func (u *Updater) TriggerUpdate(initiatedBy string) error {
|
||||
if u.updateRunning {
|
||||
u.mu.Unlock()
|
||||
u.dbg("TriggerUpdate: rejected — update already running")
|
||||
return fmt.Errorf("Frissítés már folyamatban")
|
||||
return util.MsgError("err.selfupdate.frissites_mar_folyamatban")
|
||||
}
|
||||
|
||||
// Dev version check
|
||||
if _, err := ParseVersion(u.currentVer); err != nil {
|
||||
u.mu.Unlock()
|
||||
return fmt.Errorf("Dev verzió nem frissíthető")
|
||||
return util.MsgError("err.selfupdate.dev_verzio_nem_frissitheto")
|
||||
}
|
||||
|
||||
// Backup running check
|
||||
if u.backupRunning != nil && u.backupRunning() {
|
||||
u.mu.Unlock()
|
||||
return fmt.Errorf("Mentés fut, próbálja később")
|
||||
return util.MsgError("err.selfupdate.mentes_fut_probalja_kesobb")
|
||||
}
|
||||
|
||||
// Agent reachable check — the host agent performs the swap; without it there is no update path
|
||||
// (the old in-container docker-compose flow is removed).
|
||||
if u.agent == nil {
|
||||
u.mu.Unlock()
|
||||
return fmt.Errorf("A frissítés nem érhető el (nincs gazda-ügynök)")
|
||||
return util.MsgError("err.selfupdate.a_frissites_nem_erheto_el_nincs")
|
||||
}
|
||||
|
||||
u.updateRunning = true
|
||||
@@ -529,7 +530,7 @@ func (u *Updater) TriggerUpdate(initiatedBy string) error {
|
||||
u.mu.Lock()
|
||||
u.updateRunning = false
|
||||
u.mu.Unlock()
|
||||
return fmt.Errorf("Nincs elérhető frissítés")
|
||||
return util.MsgError("err.selfupdate.nincs_elerheto_frissites")
|
||||
}
|
||||
|
||||
targetVersion := result.LatestVersion
|
||||
@@ -736,7 +737,7 @@ func (u *Updater) performUpdate(targetVersion, targetImage, previousImage, initi
|
||||
func (u *Updater) pullImage(targetImage string) error {
|
||||
hasCreds := u.gitCfg.Username != "" && u.gitCfg.Token != ""
|
||||
if !hasCreds && (u.gitCfg.Username != "" || u.gitCfg.Token != "") {
|
||||
return fmt.Errorf("docker pull: hiányos registry hitelesítő adatok (felhasználónév és token együtt szükséges)")
|
||||
return util.MsgError("err.selfupdate.docker_pull_hianyos_registry_hitelesito_adatok")
|
||||
}
|
||||
host := registryHost(u.cfg.Image)
|
||||
if hasCreds {
|
||||
|
||||
Reference in New Issue
Block a user