)
return fault{
err: err,
rate: rate,
}
}
// newFault returns an error based on the provided name. If the name is not recognized, then this method will
// panic.
header := fmt.Sprintf("fault injection error at %s with %.2f rate", methodName, errRate)
switch errName {
case "ShardOwnershipLost":
return newFaultFromError(&persistence.ShardOwnershipLostError{Msg: fmt.Sprintf("%s: persistence.ShardOwnershipLostError", header)}, errRate)