This commit is contained in:
Bel LaPointe
2025-01-14 21:19:39 -07:00
parent 44488aec2d
commit 29bc6a06b4
4 changed files with 13 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package pttodo
import (
"bytes"
"fmt"
"os"
yaml "gopkg.in/yaml.v2"
@@ -44,7 +45,7 @@ func NewRootFromFile(p string) (Root, error) {
if err := yaml.NewDecoder(f).Decode(&result); err != nil {
todos, err2 := NewTodosFromFile(p)
if err2 != nil {
return Root{}, err
return Root{}, fmt.Errorf("failed to parse yaml from %s: %w", p, err)
}
result.Todo = todos
}