I always teach my dogs the command "out" so when they start making that retching noise I tell them OUT and run to open doors for them, and usually they make it outside in time. They don't make it through the dog doors though, I have to open doors for them.