in grpc-gateway how can we chain the multiple error handlers
an eg would be look like this
import "github.com/grpc-ecosystem/grpc-gateway/runtime"
//first error handler
var runTimeError1 = func(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) {
stat, ok := status.FromError(err)
fmt.Println("body")
if !ok || len(stat.Details()) != 1 {
fmt.Println("in unknown error")
}
statusCode := runtime.HTTPStatusFromCode(stat.Code())
fmt.Println("code", statusCode)
}
// another error handler
var runTimeError2 = func(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, r *http.Request, err error) {
stat, ok := status.FromError(err)
fmt.Println("body")
if !ok || len(stat.Details()) != 1 {
fmt.Println("in unknown error")
}
statusCode := runtime.HTTPStatusFromCode(stat.Code())
fmt.Println("code", statusCode)
}
runtime.HTTPError = runTimeError1
What i would need is to combine the both errors as chain something like this
runtime.HTTPError = [runTimeError1,runTimeError2]
Is it possible to the above implementation in grpc-gateway??