mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 12:36:40 +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 {
|
||||
ri.headerWritten = true
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
// I.e. "exit code 1"
|
||||
w.Write([]byte(buildInputErr.Error()))
|
||||
|
||||
// Verbose message - i.e. stack trace
|
||||
w.Write([]byte("\n"))
|
||||
w.Write(out)
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -144,6 +150,10 @@ func pipeRequest(config *WatchdogConfig, w http.ResponseWriter, r *http.Request,
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
response := bytes.NewBufferString(err.Error())
|
||||
w.Write(response.Bytes())
|
||||
w.Write([]byte("\n"))
|
||||
if len(out) > 0 {
|
||||
w.Write(out)
|
||||
}
|
||||
ri.headerWritten = true
|
||||
}
|
||||
return
|
||||
|
Reference in New Issue
Block a user