Skip to content

Commit

Permalink
Print message for missing metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
cgxeiji committed Nov 8, 2018
1 parent ee77318 commit 8f34206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ to set the correct path of this library.
if dir.IsDir() {
d, err := ioutil.ReadFile(filepath.Join(path, dir.Name(), "entry.yaml"))
if err != nil {
panic(err)
fmt.Println("Could not find data for:", dir.Name())
return
}
var e scholar.Entry
if err := yaml.Unmarshal(d, &e); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func entryFromKey(key string) *scholar.Entry {
if dir.IsDir() && dir.Name() == strings.TrimSpace(key) {
d, err := ioutil.ReadFile(filepath.Join(libraryPath(), dir.Name(), "entry.yaml"))
if err != nil {
panic(err)
fmt.Println("Could not find data for:", dir.Name())
continue
}

var e scholar.Entry
Expand Down

0 comments on commit 8f34206

Please sign in to comment.