If your generator does get wet, back off and wait for it to dry down. If you unplug and plug your generator during rainy weather for example, you put yourself at risk for electrocution. So, do not reset your outlets while it is wet.
So, your best bet is to put the cover on the generator.
If it just started raining, though, you can try to put the cover on the generator without touching it to secure it. If you touch your generator while wet, you may be electrocuted.
No guarantees it hasn’t already went bad, though. Putting the cover beforehand is the choice you’d want to make.