Add debug logging for YAML parse errors in autoimport (bd-mql4)
When config.yaml has malformed YAML, getLocalSyncBranch and isNoDbModeConfigured were silently returning empty/false with no feedback, making debugging difficult. Now they log a warning via debug.Logf when YAML parsing fails. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1683
.beads/issues.jsonl
1683
.beads/issues.jsonl
File diff suppressed because one or more lines are too long
@@ -12,6 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/steveyegge/beads/internal/beads"
|
"github.com/steveyegge/beads/internal/beads"
|
||||||
|
"github.com/steveyegge/beads/internal/debug"
|
||||||
"github.com/steveyegge/beads/internal/git"
|
"github.com/steveyegge/beads/internal/git"
|
||||||
"github.com/steveyegge/beads/internal/storage"
|
"github.com/steveyegge/beads/internal/storage"
|
||||||
"github.com/steveyegge/beads/internal/syncbranch"
|
"github.com/steveyegge/beads/internal/syncbranch"
|
||||||
@@ -173,6 +174,7 @@ func isNoDbModeConfigured(beadsDir string) bool {
|
|||||||
|
|
||||||
var cfg localConfig
|
var cfg localConfig
|
||||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||||
|
debug.Logf("Warning: failed to parse config.yaml for no-db check: %v", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +200,7 @@ func getLocalSyncBranch(beadsDir string) string {
|
|||||||
// Parse YAML properly to handle edge cases (comments, indentation, special chars)
|
// Parse YAML properly to handle edge cases (comments, indentation, special chars)
|
||||||
var cfg localConfig
|
var cfg localConfig
|
||||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||||
|
debug.Logf("Warning: failed to parse config.yaml for sync-branch: %v", err)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user