Skip to content

🎧 Your Personal Streaming Service

Renamed error variable

Deluan5fc3b3ff11bc
diff --git a/api/browsing.go b/api/browsing.go
index 87c4b8f91..d05f4dad0 100644
--- a/api/browsing.go
+++ b/api/browsing.go
@@ -68,7 +68,7 @@ func (c *BrowsingController) GetDirectory() {
dir, err := c.browser.Directory(id)
switch {
- case err == engine.DataNotFound:
+ case err == engine.ErrDataNotFound:
beego.Error("Requested Id", id, "not found:", err)
c.SendError(responses.ERROR_DATA_NOT_FOUND, "Directory not found")
case err != nil:
diff --git a/api/get_cover_art.go b/api/get_cover_art.go
index 71f2f15d2..a17c1f605 100644
--- a/api/get_cover_art.go
+++ b/api/get_cover_art.go
@@ -24,7 +24,7 @@ func (c *GetCoverArtController) Get() {
err := c.cover.Get(id, size, c.Ctx.ResponseWriter)
switch {
- case err == engine.DataNotFound:
+ case err == engine.ErrDataNotFound:
beego.Error(err, "Id:", id)
c.SendError(responses.ERROR_DATA_NOT_FOUND, "Directory not found")
case err != nil:
diff --git a/api/playlists.go b/api/playlists.go
index 38c2c492e..40f0bc57c 100644
--- a/api/playlists.go
+++ b/api/playlists.go
@@ -40,7 +40,7 @@ func (c *PlaylistsController) Get() {
pinfo, err := c.pls.Get(id)
switch {
- case err == engine.DataNotFound:
+ case err == engine.ErrDataNotFound:
beego.Error(err, "Id:", id)
c.SendError(responses.ERROR_DATA_NOT_FOUND, "Directory not found")
case err != nil:
diff --git a/engine/browser.go b/engine/browser.go
index 8fa61cc6c..e891199b9 100644
--- a/engine/browser.go
+++ b/engine/browser.go
@@ -78,7 +78,7 @@ func (c browser) Directory(id string) (*DirectoryInfo, error) {
dir = c.buildAlbumDir(al, tracks)
default:
beego.Debug("Id", id, "not found")
- return nil, DataNotFound
+ return nil, ErrDataNotFound
}
return dir, nil
diff --git a/engine/common.go b/engine/common.go
index 9ac485845..2b9d2d2b3 100644
--- a/engine/common.go
+++ b/engine/common.go
@@ -25,5 +25,5 @@ type Child struct {
}
var (
- DataNotFound = errors.New("Data Not Found")
+ ErrDataNotFound = errors.New("Data Not Found")
)
diff --git a/engine/cover.go b/engine/cover.go
index 526689760..3492aa2cd 100644
--- a/engine/cover.go
+++ b/engine/cover.go
@@ -48,7 +48,7 @@ func (c cover) Get(id string, size int, out io.Writer) error {
}
if err != nil {
- return DataNotFound
+ return ErrDataNotFound
}
if size > 0 {
diff --git a/engine/cover_test.go b/engine/cover_test.go
index 702de3246..3d9dfdf25 100644
--- a/engine/cover_test.go
+++ b/engine/cover_test.go
@@ -53,7 +53,7 @@ func TestCover(t *testing.T) {
err := cover.Get("2", 0, out)
Convey("Then it should return DatNotFound error", func() {
- So(err, ShouldEqual, engine.DataNotFound)
+ So(err, ShouldEqual, engine.ErrDataNotFound)
})
})
Convey("When specifying a size", func() {
diff --git a/engine/playlists.go b/engine/playlists.go
index d65cdffc9..834e8ad67 100644
--- a/engine/playlists.go
+++ b/engine/playlists.go
@@ -35,7 +35,7 @@ func (p playlists) Get(id string) (*PlaylistInfo, error) {
}
if pl == nil {
- return nil, DataNotFound
+ return nil, ErrDataNotFound
}
pinfo := &PlaylistInfo{Id: pl.Id, Name: pl.Name}