In playlist load() add an error message.
This commit is contained in:
parent
e0fa65fbd7
commit
f8fd13f8ed
@ -4,6 +4,8 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Playlist holds a list of paths to a song files.
|
||||
@ -46,7 +48,7 @@ func (p *Playlist) Next() (song string) {
|
||||
func (p *Playlist) load() error {
|
||||
data, err := os.ReadFile(p.filePath)
|
||||
if err != nil {
|
||||
return err
|
||||
return errors.Wrap(err, "cannot open a playlist file")
|
||||
}
|
||||
p.Lock()
|
||||
p.playlist = strings.Split(string(data), "\n")
|
||||
|
Loading…
Reference in New Issue
Block a user