diff --git a/frontend/http/frontend.go b/frontend/http/frontend.go index 8ff5998..914d2a4 100644 --- a/frontend/http/frontend.go +++ b/frontend/http/frontend.go @@ -39,7 +39,11 @@ var promResponseDurationMilliseconds = prometheus.NewHistogramVec( func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) { var errString string if err != nil { - errString = err.Error() + if _, ok := err.(bittorrent.ClientError); ok { + errString = err.Error() + } else { + errString = "internal error" + } } var afString string diff --git a/frontend/udp/frontend.go b/frontend/udp/frontend.go index 405d1ca..bbeb648 100644 --- a/frontend/udp/frontend.go +++ b/frontend/udp/frontend.go @@ -42,7 +42,11 @@ var promResponseDurationMilliseconds = prometheus.NewHistogramVec( func recordResponseDuration(action string, af *bittorrent.AddressFamily, err error, duration time.Duration) { var errString string if err != nil { - errString = err.Error() + if _, ok := err.(bittorrent.ClientError); ok { + errString = err.Error() + } else { + errString = "internal error" + } } var afString string