Skip to content

Commit

Permalink
fix: Added error handling for unmarshalling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RamiAwar committed May 8, 2024
1 parent 15a7e9b commit 06314d7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion snippet/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ func (snippets *Snippets) Load() error {
if err != nil {
return fmt.Errorf("failed to load snippet file. %v", err)
}
toml.Unmarshal(f, snippets)

err = toml.Unmarshal(f, snippets)
if err != nil {
return fmt.Errorf("failed to unmarshal snippet file. %v", err)
}

snippets.Order()
return nil
}
Expand Down

0 comments on commit 06314d7

Please sign in to comment.