| 105 | func (h *pipelineErrInjector) ProcessHook(next redis.ProcessHook) redis.ProcessHook { return next } |
| 106 | |
| 107 | func (h *pipelineErrInjector) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook { |
| 108 | return func(ctx context.Context, cmds []redis.Cmder) error { |
| 109 | for _, cmd := range cmds { |
| 110 | if strings.EqualFold(cmd.Name(), "exec") { |
| 111 | return h.err // do not call next: EXEC never runs |
| 112 | } |
| 113 | } |
| 114 | return next(ctx, cmds) |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // cmdErrInjector fails a single named command without sending it, simulating a |
| 119 | // server error on that command (e.g. a WATCH that the server rejects). |