{"record":{"id":"c396d72fbf1175af","repo":"sipeed/picoclaw","slug":"error-loading-config-w-c396d7","errorCode":null,"errorMessage":"error loading config: %w","messagePattern":"error loading config: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/gateway/gateway.go","lineNumber":153,"sourceCode":"\t\tlogger.SetLevel(logger.DEBUG)\n\t} else {\n\t\tlogger.SetLevelFromString(config.ResolveGatewayLogLevel(configPath))\n\t}\n\tdefer func() {\n\t\tif runErr != nil {\n\t\t\tlogger.ErrorCF(\"gateway\", \"Gateway startup failed\", map[string]any{\n\t\t\t\t\"config_path\": configPath,\n\t\t\t\t\"error\":       runErr.Error(),\n\t\t\t\t\"home_path\":   homePath,\n\t\t\t\t\"allow_empty\": allowEmptyStartup,\n\t\t\t\t\"debug\":       debug,\n\t\t\t})\n\t\t}\n\t}()\n\n\tcfg, err := config.LoadConfig(configPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error loading config: %w\", err)\n\t}\n\n\tif err = preCheckConfig(cfg); err != nil {\n\t\treturn fmt.Errorf(\"config pre-check failed: %w\", err)\n\t}\n\n\t// Debug mode permanently overrides the config log level to DEBUG.\n\tif debug {\n\t\tfmt.Println(\"🔍 Debug mode enabled\")\n\t} else {\n\t\teffectiveLogLevel := config.EffectiveGatewayLogLevel(cfg)\n\t\tlogger.SetLevelFromString(effectiveLogLevel)\n\t\tlogger.Infof(\"Log level set to %q\", effectiveLogLevel)\n\t}\n\n\tbindPlan, listenResult, err := openGatewayListeners(cfg.Gateway.Host, cfg.Gateway.Port)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error opening gateway listeners: %w\", err)","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/gateway/gateway.go#L135-L171","documentation":"Error \"error loading config: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/gateway/gateway.go:153 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"}