Commit 98c9a13d authored by Alain Takoudjou's avatar Alain Takoudjou

fixup: LogError was removed add it back as it's used by xblob

parent f15ab356
......@@ -75,7 +75,7 @@ func handleGetBlobRaw(a *api.API, w http.ResponseWriter, r *http.Request, repoPa
// this way it will be read one time only and next reads will be empty.
_, err := w.Write(authReply.RawReply.Body.Bytes())
if err != nil {
helper.LogError(r, fmt.Errorf("writing authReply.RawReply.Body: %v", err))
helper.LogError(r, fmt.Errorf("writing authReply.RawReply.Body: %v", err), nil)
}
return
}
......@@ -234,7 +234,7 @@ func emitBlob(w http.ResponseWriter, repopath string, refpath string, r *http.Re
if size > buffsize {
_, err = io.CopyN(w, queryReader, size-buffsize)
if err != nil {
helper.LogError(r, fmt.Errorf("io.CopyN: %v", err))
helper.LogError(r, fmt.Errorf("io.CopyN: %v", err), nil)
return
}
}
......@@ -242,13 +242,13 @@ func emitBlob(w http.ResponseWriter, repopath string, refpath string, r *http.Re
// close git stdin explicitly, so it can exit cleanly
err = queryStdin.Close()
if err != nil {
helper.LogError(r, fmt.Errorf("queryStdin.Close: %v", err))
helper.LogError(r, fmt.Errorf("queryStdin.Close: %v", err), nil)
return
}
err = queryCmd.Wait()
if err != nil {
helper.LogError(r, fmt.Errorf("wait: %v", err))
helper.LogError(r, fmt.Errorf("wait: %v", err), nil)
return
}
}
......@@ -20,6 +20,10 @@ import (
const NginxResponseBufferHeader = "X-Accel-Buffering"
func LogError(r *http.Request, err error) {
LogErrorWithFields(r, err, nil)
}
func logErrorWithFields(r *http.Request, err error, fields log.Fields) {
if err != nil {
CaptureRavenError(r, err, fields)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment