There would be no way to shelter from a nearby gamma ray burst. You would die and there would be nothing you or anybody else could do about it, except maybe commit suicide to avoid the coming trauma.
Well you could get lucky and be on the other side of the world from the source. It's just then that you have to figure out how to shelter yourself from years of acid rain.
In that sense an asteroid strike is worse, apparently it sends up shards of glass that hit at a density of more than one per square meter, all around the world.