mirror of
https://github.com/openfaas/faas.git
synced 2025-06-21 11:46:29 +00:00
Watchdog - Write error / stack to caller.
This commit is contained in:
@ -85,7 +85,13 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
|
|||||||
if buildInputErr != nil {
|
if buildInputErr != nil {
|
||||||
ri.headerWritten = true
|
ri.headerWritten = true
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
// I.e. "exit code 1"
|
||||||
w.Write([]byte(buildInputErr.Error()))
|
w.Write([]byte(buildInputErr.Error()))
|
||||||
|
|
||||||
|
// Verbose message - i.e. stack trace
|
||||||
|
w.Write([]byte("\n"))
|
||||||
|
w.Write(out)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,6 +150,10 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
|
|||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
response := bytes.NewBufferString(err.Error())
|
response := bytes.NewBufferString(err.Error())
|
||||||
w.Write(response.Bytes())
|
w.Write(response.Bytes())
|
||||||
|
w.Write([]byte("\n"))
|
||||||
|
if len(out) > 0 {
|
||||||
|
w.Write(out)
|
||||||
|
}
|
||||||
ri.headerWritten = true
|
ri.headerWritten = true
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user