1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-07 23:02:12 +02:00

examples/blog:keep the grpc and http error consistent (#873)

This commit is contained in:
opensite 2021-04-28 14:31:23 +08:00 committed by GitHub
parent b8d5d709e9
commit 8dc92ef8b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ import (
"github.com/go-kratos/kratos/v2/middleware"
"github.com/go-kratos/kratos/v2/middleware/logging"
"github.com/go-kratos/kratos/v2/middleware/recovery"
"github.com/go-kratos/kratos/v2/middleware/status"
"github.com/go-kratos/kratos/v2/middleware/tracing"
"github.com/go-kratos/kratos/v2/transport/http"
"go.opentelemetry.io/otel/trace"
@ -27,6 +28,7 @@ func NewHTTPServer(c *conf.Server, tracer trace.TracerProvider, blog *service.Bl
}
m := http.Middleware(
middleware.Chain(
status.Server(),
tracing.Server(tracing.WithTracerProvider(tracer)),
logging.Server(log.DefaultLogger),
recovery.Recovery(),