Log stderr from CGI processes which exit with non-zero status to the error log. Closes #7.
This commit is contained in:
parent
b9334e07a9
commit
7d8bacdc90
|
@ -64,7 +64,10 @@ func handleCGI(config Config, path string, cgiPath string, URL *url.URL, log *Lo
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorLog.Println("Error starting CGI executable " + path + ": " + err.Error())
|
errorLog.Println("Error running CGI program " + path + ": " + err.Error())
|
||||||
|
if err, ok := err.(*exec.ExitError); ok {
|
||||||
|
errorLog.Println("↳ stderr output: " + string(err.Stderr))
|
||||||
|
}
|
||||||
conn.Write([]byte("42 CGI error!\r\n"))
|
conn.Write([]byte("42 CGI error!\r\n"))
|
||||||
log.Status = 42
|
log.Status = 42
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue