wrap request read error as bad request

This commit is contained in:
Aneurin Barker Snook
2023-10-13 20:44:55 +01:00
parent 1c8a68bbcb
commit 33eba7de84
+1 -1
View File
@@ -11,7 +11,7 @@ import (
func ReadRequestJSON(req *http.Request, v any) error {
data, err := io.ReadAll(req.Body)
if err != nil {
return err
return ErrBadRequest.WithError(err)
}
return json.Unmarshal(data, v)
}