mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-15 03:30:39 +03:00
Renamed error variable
This commit is contained in:
parent
42f3279aaf
commit
5fc3b3ff11
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -25,5 +25,5 @@ type Child struct {
|
||||
}
|
||||
|
||||
var (
|
||||
DataNotFound = errors.New("Data Not Found")
|
||||
ErrDataNotFound = errors.New("Data Not Found")
|
||||
)
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user