From d463b235b6b94b4a99fa66dee6c1c21dd6e21eb3 Mon Sep 17 00:00:00 2001 From: Leo Balduf Date: Wed, 28 Sep 2016 02:47:05 -0400 Subject: [PATCH] http: log internal server errors --- frontend/http/writer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/http/writer.go b/frontend/http/writer.go index 54b3fe2..82765d6 100644 --- a/frontend/http/writer.go +++ b/frontend/http/writer.go @@ -3,6 +3,8 @@ package http import ( "net/http" + log "github.com/Sirupsen/logrus" + "github.com/chihaya/chihaya/bittorrent" "github.com/chihaya/chihaya/frontend/http/bencode" ) @@ -12,6 +14,8 @@ func WriteError(w http.ResponseWriter, err error) error { message := "internal server error" if _, clientErr := err.(bittorrent.ClientError); clientErr { message = err.Error() + } else { + log.Errorf("http: internal error: %s", err) } w.WriteHeader(http.StatusOK)