{"record":{"id":"f83b100d523c20fd","repo":"sipeed/picoclaw","slug":"failed-to-load-config-v","errorCode":null,"errorMessage":"Failed to load config: %v","messagePattern":"Failed to load config: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"web/backend/api/config.go","lineNumber":39,"sourceCode":"\tmux.HandleFunc(\"POST /api/config/reset\", h.handleResetConfig)\n\tmux.HandleFunc(\"POST /api/config/test-command-patterns\", h.handleTestCommandPatterns)\n}\n\nfunc (h *Handler) applyRuntimeLogLevel() {\n\tif h.debug {\n\t\tlogger.SetLevel(logger.DEBUG)\n\t\treturn\n\t}\n\tlogger.SetLevelFromString(config.ResolveGatewayLogLevel(h.configPath))\n}\n\n// handleGetConfig returns the complete system configuration.\n//\n//\tGET /api/config\nfunc (h *Handler) handleGetConfig(w http.ResponseWriter, r *http.Request) {\n\tcfg, err := config.LoadConfig(h.configPath)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Failed to load config: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tif err := json.NewEncoder(w).Encode(cfg); err != nil {\n\t\thttp.Error(w, \"Failed to encode response\", http.StatusInternalServerError)\n\t}\n}\n\n// handleUpdateConfig updates the complete system configuration.\n//\n//\tPUT /api/config\nfunc (h *Handler) handleUpdateConfig(w http.ResponseWriter, r *http.Request) {\n\tbody, err := io.ReadAll(io.LimitReader(r.Body, 1<<20))\n\tif err != nil {\n\t\thttp.Error(w, \"Failed to read request body\", http.StatusBadRequest)\n\t\treturn\n\t}","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/web/backend/api/config.go#L21-L57","documentation":"Error \"Failed to load config: %v\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at web/backend/api/config.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}