responderror auto sprintf

This commit is contained in:
sentriz
2019-05-28 15:07:58 +01:00
parent 74c55bd509
commit e7ed19abd9
5 changed files with 13 additions and 18 deletions

View File

@@ -3,6 +3,7 @@ package handler
import (
"encoding/json"
"encoding/xml"
"fmt"
"log"
"net/http"
@@ -49,8 +50,8 @@ func respond(w http.ResponseWriter, r *http.Request,
}
func respondError(w http.ResponseWriter, r *http.Request,
code int, message string) {
code int, message string, a ...interface{}) {
respondRaw(w, r, http.StatusBadRequest, subsonic.NewError(
code, message,
code, fmt.Sprintf(message, a...),
))
}