This commit is contained in:
2026-03-05 13:22:00 +03:00
commit f276b28be7
10 changed files with 510 additions and 0 deletions

23
subsonic/error.go Normal file
View File

@@ -0,0 +1,23 @@
package subsonic
type Error struct {
Code int `xml:"code,attr" json:"code"`
Message string `xml:"message,attr" json:"message"`
}
type ErrorResponse struct {
Response
Error Error `xml:"error" json:"error"`
}
var (
ErrorGeneric = Error{0, "A generic error."}
ErrorRequired = Error{10, "Required parameter is missing."}
ErrorIncompatibleClient = Error{20, "Incompatible Subsonic REST protocol version. Client must upgrade."}
ErrorIncompatibleServer = Error{30, "Incompatible Subsonic REST protocol version. Server must upgrade."}
ErrorWrongAuth = Error{40, "Wrong username or password."}
ErrorLDAPTokenAuth = Error{41, "Token authentication not supported for LDAP users."}
ErrorUserUnauthorized = Error{50, "User is not authorized for the given operation."}
ErrorTrialPeriodEnded = Error{60, "The trial period for the Subsonic server is over. Please upgrade to Subsonic Premium. Visit subsonic.org for details. "}
ErrorNotFound = Error{70, "The requested data was not found."}
)