Add req.Params to replace utils.Param*
This commit is contained in:
@@ -2,6 +2,7 @@ package subsonic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"mime"
|
||||
"net/http"
|
||||
@@ -62,6 +63,13 @@ func newError(code int, message ...interface{}) error {
|
||||
}
|
||||
}
|
||||
|
||||
// errSubsonic and Unwrap are used to allow `errors.Is(err, errSubsonic)` to work
|
||||
var errSubsonic = errors.New("subsonic API error")
|
||||
|
||||
func (e subError) Unwrap() error {
|
||||
return fmt.Errorf("%w: %d", errSubsonic, e.code)
|
||||
}
|
||||
|
||||
func (e subError) Error() string {
|
||||
var msg string
|
||||
if len(e.messages) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user