adds trace to bad data for inspection

This commit is contained in:
Hyatt 2022-01-10 09:52:51 -06:00
parent 7e377f8c5c
commit 0c1d1e21be
Signed by: nhyatt
GPG Key ID: C50D0BBB5BC40BEA

View File

@ -200,10 +200,11 @@ func tmpltTPlinkPost(w http.ResponseWriter, r *http.Request) {
err := json.NewDecoder(r.Body).Decode(&payload) err := json.NewDecoder(r.Body).Decode(&payload)
if err != nil { if err != nil {
log.Printf("[TRACE] Data received: %#v\n", r.Body)
log.Printf("[INFO] Unable to parse payload from API call: %v\n", err) log.Printf("[INFO] Unable to parse payload from API call: %v\n", err)
tmpltError(w, http.StatusInternalServerError, fmt.Sprintf("Unable to read info from device: %v\n", err)) tmpltError(w, http.StatusInternalServerError, fmt.Sprintf("Unable to read info from device: %v\n", err))
return return
} }
log.Printf("[TRACE] Data received: %#v\n", payload) log.Printf("[TRACE] Data received: %#v\n", payload)
} }