Change http status messages for go1.5.1 compatibility.

pull/578/head ahrs0.1
Eric Westphal 2017-02-17 11:11:27 -05:00
rodzic f2cfe3344b
commit 2ba3f136bb
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -397,14 +397,14 @@ func handleOrientAHRS(w http.ResponseWriter, r *http.Request) {
case 'f': // Set sensor "forward" direction (toward nose of airplane). case 'f': // Set sensor "forward" direction (toward nose of airplane).
if f, err = getMinAccelDirection(); err != nil { if f, err = getMinAccelDirection(); err != nil {
log.Printf("AHRS Error: sensor orientation: couldn't read accelerometer: %s\n", err) log.Printf("AHRS Error: sensor orientation: couldn't read accelerometer: %s\n", err)
http.Error(w, fmt.Sprintf("couldn't read accelerometer: %s\n", err), http.StatusFailedDependency) http.Error(w, fmt.Sprintf("couldn't read accelerometer: %s\n", err), http.StatusBadRequest)
return return
} }
log.Printf("AHRS Info: sensor orientation: received forward direction %d\n", f) log.Printf("AHRS Info: sensor orientation: received forward direction %d\n", f)
case 'u': // Set sensor "up" direction (toward top of airplane). case 'u': // Set sensor "up" direction (toward top of airplane).
if u, err = getMinAccelDirection(); err != nil { if u, err = getMinAccelDirection(); err != nil {
log.Printf("AHRS Error: sensor orientation: couldn't read accelerometer: %s\n", err) log.Printf("AHRS Error: sensor orientation: couldn't read accelerometer: %s\n", err)
http.Error(w, fmt.Sprintf("couldn't read accelerometer: %s\n", err), http.StatusFailedDependency) http.Error(w, fmt.Sprintf("couldn't read accelerometer: %s\n", err), http.StatusBadRequest)
return return
} }
log.Printf("AHRS Info: sensor orientation: received up direction %d\n", u) log.Printf("AHRS Info: sensor orientation: received up direction %d\n", u)