Skip to content

fix(watcher): log swallowed config-load error instead of discarding it#457

Merged
Harsh4902 merged 1 commit into
microcks:masterfrom
Caesarsage:fix/watcher-swallowed-config-error
Jun 15, 2026
Merged

fix(watcher): log swallowed config-load error instead of discarding it#457
Harsh4902 merged 1 commit into
microcks:masterfrom
Caesarsage:fix/watcher-swallowed-config-error

Conversation

@Caesarsage

Copy link
Copy Markdown
Contributor

Description

TriggerImport in pkg/watcher/executor.go built an error with fmt.Errorf
on a config-load failure and then discarded the result, so the failure was
silently swallowed — nothing logged, nothing returned, execution continued
with an empty config path.

cfgPath, err := config.DefaultLocalConfigPath()
if err != nil {
    fmt.Errorf("Error while loading config: %s", err.Error())  // result discarded
}

Replaced it with a logged error (matching the [ERROR]/[WARN] style the rest
of the function already uses) and an early return, since there's no point
continuing without a config path.

So this also un-breaks go vet ./... for the whole module.

How verified

go vet ./... — now clean (previously reported the error above)
go build ./... and go test ./... pass

Surfaced while working on the CLI v2 mentorship. Refs #255

Signed-off-by: caesarsage <destinyerhabor6@gmail.com>

@Harsh4902 Harsh4902 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go.

@Harsh4902 Harsh4902 added this to the Next milestone Jun 15, 2026
@Harsh4902 Harsh4902 merged commit f883c02 into microcks:master Jun 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants