mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-18 15:52:01 +00:00
15 lines
408 B
Go
15 lines
408 B
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func ErrorHandler() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
|
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
|
resp, err := handler(ctx, req)
|
|
return resp, CaosToGRPCError(err)
|
|
}
|
|
}
|