Renamed error variable

This commit is contained in:
Deluan 2016-03-10 11:25:15 -05:00
parent 42f3279aaf
commit 5fc3b3ff11
8 changed files with 8 additions and 8 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -25,5 +25,5 @@ type Child struct {
}
var (
DataNotFound = errors.New("Data Not Found")
ErrDataNotFound = errors.New("Data Not Found")
)

View File

@ -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 {

View File

@ -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() {

View File

@ -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}