We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b73765 commit 7266030Copy full SHA for 7266030
backend/playbackengine.go
@@ -3,6 +3,7 @@ package backend
3
import (
4
"context"
5
"errors"
6
+ "fmt"
7
"log"
8
"math/rand"
9
"time"
@@ -223,8 +224,8 @@ func (p *playbackEngine) PlayTrackAt(idx int) error {
223
224
}
225
226
func (p *playbackEngine) playTrackAt(idx int, startTime float64) error {
- if idx < 0 || idx >= len(p.playQueue) {
227
- return errors.New("track index out of range")
+ if l := len(p.playQueue); idx < 0 || idx >= l {
228
+ return fmt.Errorf("track index (%d) out of range (0-%d)", idx, l)
229
230
// scrobble current track if needed
231
p.checkScrobble()
0 commit comments