diff --git a/pkg/config/gateway.go b/pkg/config/gateway.go index 392a4ca5e..81707273a 100644 --- a/pkg/config/gateway.go +++ b/pkg/config/gateway.go @@ -88,7 +88,12 @@ func ResolveGatewayLogLevel(path string) string { data, err := os.ReadFile(path) if err == nil { - _ = json.Unmarshal(data, &cfg) + if err := json.Unmarshal(data, &cfg); err != nil { + logger.WarnCF("config", "failed to parse gateway config, using defaults", map[string]any{ + "path": path, + "error": err.Error(), + }) + } } if envLevel := os.Getenv("PICOCLAW_LOG_LEVEL"); envLevel != "" { diff --git a/pkg/seahorse/short_retrieval.go b/pkg/seahorse/short_retrieval.go index 3e94eec14..c9f1dd70e 100644 --- a/pkg/seahorse/short_retrieval.go +++ b/pkg/seahorse/short_retrieval.go @@ -22,7 +22,10 @@ func ParseLastDuration(s string) (time.Duration, error) { return 0, fmt.Errorf("invalid duration format: %q (use format like 6h, 7d, 2w, 1m)", s) } - value, _ := strconv.Atoi(matches[1]) + value, err := strconv.Atoi(matches[1]) + if err != nil { + return 0, fmt.Errorf("invalid duration value: %q", matches[1]) + } unit := matches[2] switch unit {