Fix error comparisons
This commit is contained in:
@@ -3,6 +3,7 @@ package subsonic
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"runtime"
|
||||
@@ -183,7 +184,7 @@ func h(r chi.Router, path string, f handler) {
|
||||
if err != nil {
|
||||
// If it is not a Subsonic error, convert it to an ErrorGeneric
|
||||
if _, ok := err.(subError); !ok {
|
||||
if err == model.ErrNotFound {
|
||||
if errors.Is(err, model.ErrNotFound) {
|
||||
err = newError(responses.ErrorDataNotFound, "data not found")
|
||||
} else {
|
||||
err = newError(responses.ErrorGeneric, "Internal Error")
|
||||
|
||||
Reference in New Issue
Block a user