How exactly do optimizers reject infinity loss?

They skip the current step and do some line search thing. I know the Optim.jl algorithms support this. I need to dig around to see which others do it well.