2016-02-24 14:06:49 -09:00
|
|
|
package responses
|
|
|
|
|
|
|
|
|
|
const (
|
2016-03-23 08:35:10 -08:00
|
|
|
ErrorGeneric = iota * 10
|
|
|
|
|
ErrorMissingParameter
|
|
|
|
|
ErrorClientTooOld
|
|
|
|
|
ErrorServerTooOld
|
|
|
|
|
ErrorAuthenticationFail
|
|
|
|
|
ErrorAuthorizationFail
|
|
|
|
|
ErrorTrialExpired
|
|
|
|
|
ErrorDataNotFound
|
2016-02-24 14:06:49 -09:00
|
|
|
)
|
|
|
|
|
|
2020-01-08 06:25:23 -09:00
|
|
|
var errors = map[int]string{
|
|
|
|
|
ErrorGeneric: "A generic error",
|
|
|
|
|
ErrorMissingParameter: "Required parameter is missing",
|
|
|
|
|
ErrorClientTooOld: "Incompatible Subsonic REST protocol version. Client must upgrade",
|
|
|
|
|
ErrorServerTooOld: "Incompatible Subsonic REST protocol version. Server must upgrade",
|
|
|
|
|
ErrorAuthenticationFail: "Wrong username or password",
|
|
|
|
|
ErrorAuthorizationFail: "User is not authorized for the given operation",
|
|
|
|
|
ErrorTrialExpired: "The trial period for the Subsonic server is over. Please upgrade to Subsonic Premium. Visit subsonic.org for details",
|
|
|
|
|
ErrorDataNotFound: "The requested data was not found",
|
2016-02-24 14:06:49 -09:00
|
|
|
}
|
|
|
|
|
|
2016-03-02 09:04:55 -09:00
|
|
|
func ErrorMsg(code int) string {
|
|
|
|
|
if v, found := errors[code]; found {
|
|
|
|
|
return v
|
2016-03-01 08:35:30 -09:00
|
|
|
}
|
2016-03-23 08:35:10 -08:00
|
|
|
return errors[ErrorGeneric]
|
2016-02-25 14:52:07 -09:00
|
|
|
}
|