Fix error comparisons

This commit is contained in:
Deluan
2022-09-30 18:54:25 -04:00
parent 7b0a8f47de
commit db67c1277e
27 changed files with 93 additions and 73 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
package subsonic
import (
"errors"
"io"
"net/http"
"regexp"
@@ -66,11 +67,11 @@ func (c *MediaRetrievalController) GetCoverArt(w http.ResponseWriter, r *http.Re
w.Header().Set("cache-control", "public, max-age=315360000")
imgReader, err := c.artwork.Get(r.Context(), id, size)
switch {
case err == model.ErrNotFound:
if errors.Is(err, model.ErrNotFound) {
log.Error(r, "Couldn't find coverArt", "id", id, err)
return nil, newError(responses.ErrorDataNotFound, "Artwork not found")
case err != nil:
}
if err != nil {
log.Error(r, "Error retrieving coverArt", "id", id, err)
return nil, err
}