{"record":{"id":"5f08c131bf9a17b0","repo":"gastownhall/beads","slug":"load-infra-types-w","errorCode":null,"errorMessage":"load infra types: %w","messagePattern":"load infra types: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/workapi/list.go","lineNumber":159,"sourceCode":"\tstatuses, err := src.GetCustomStatuses(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load custom statuses: %w\", err)\n\t}\n\tcfg.CustomStatuses = statuses\n\n\tct, err := src.GetCustomTypes(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load custom types: %w\", err)\n\t}\n\tif len(ct) > 0 {\n\t\tcfg.CustomTypes = ct\n\t} else {\n\t\tcfg.CustomTypes = config.GetCustomTypesFromYAML()\n\t}\n\n\tinfraSet, err := src.GetInfraTypes(ctx)\n\tif err != nil {\n\t\treturn cfg, fmt.Errorf(\"load infra types: %w\", err)\n\t}\n\tif len(infraSet) > 0 {\n\t\tcfg.InfraSet = infraSet\n\t}\n\n\treturn cfg, nil\n}\n\n// LoadStoreListConfig loads the list configuration from a store handle. A nil\n// store (no workspace open) still yields the YAML custom types.\nfunc LoadStoreListConfig(ctx context.Context, store storage.DoltStorage) (ListConfig, error) {\n\tif store == nil {\n\t\treturn ListConfig{CustomTypes: config.GetCustomTypesFromYAML()}, nil\n\t}\n\treturn LoadListConfig(ctx, NewStoreConfigSource(store))\n}\n\n// LoadUOWListConfig loads the list configuration through an open unit of work.","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/workapi/list.go#L141-L177","documentation":"LoadListConfig builds the ListConfig used by list filtering. As part of that it fetches the set of infra types from the ConfigSource (store or unit-of-work). When that fetch fails, the underlying error (storage/connection/interceptor failure) is wrapped as 'load infra types: %w' so callers know which config step failed.","triggerScenarios":"Calling LoadStoreListConfig or LoadUOWListConfig (or LoadListConfig directly) when the underlying ConfigSource.GetInfraTypes call errors — e.g. the store/db connection is unavailable or the config-usecase query fails.","commonSituations":"Database not reachable or corrupt when opening a workspace; calling list helpers without an initialized store/UOW; transient storage failures during 'bd list' startup.","solutions":["Inspect the wrapped error (%w) for the root cause — usually a storage/connection failure","Verify the workspace/store is opened and reachable before calling Load*ListConfig","Retry the load if the underlying failure is transient","If a nil store is acceptable in your flow, use LoadStoreListConfig which handles nil by returning YAML-only config"],"exampleFix":"// before\ncfg, err := workapi.LoadUOWListConfig(ctx, uw)\n// after\ncfg, err := workapi.LoadUOWListConfig(ctx, uw)\nif err != nil {\n    var storeErr *storage.ConnectError\n    if errors.As(err, &storeErr) { /* reopen store, retry */ }\n    return err\n}","handlingStrategy":"try-catch","validationCode":"// Ensure store is reachable before loading config\nif store == nil {\n    return ListConfig{CustomTypes: config.GetCustomTypesFromYAML()}, nil\n}\nif err := store.Ping(ctx); err != nil {\n    return fmt.Errorf(\"store unavailable: %w\", err)\n}","typeGuard":"func storeReady(s storage.DoltStorage) bool { return s != nil }","tryCatchPattern":"cfg, err := workapi.LoadStoreListConfig(ctx, store)\nif err != nil {\n    return fmt.Errorf(\"cannot load list config: %w\", err)\n}","preventionTips":["Check store connectivity before listing operations","Handle nil-store case explicitly (LoadStoreListConfig already does)","Surface the wrapped root cause in logs for diagnosis","Add retry around config load for transient storage failures"],"tags":["config","storage","wrapping"],"backgroundTag":"config-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}