feat: add error message if analyze request fail (#393)

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
Matthis 2023-05-09 18:08:39 +02:00 committed by GitHub
parent 123b8a66ee
commit 639aa12931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package server
import (
"context"
"fmt"
"time"
"go.uber.org/zap"
@ -34,7 +35,7 @@ func logInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor {
}
message := "request completed"
if err != nil {
message = "request failed"
message = fmt.Sprintf("request failed. %s", err.Error())
}
logRequest(logger, fields, int(status.Code(err)), message)