Hi ColorADay. Welcome to EF. upon pain of something is a common phrase which means "the something follows imminently if the [condition]" "You use upon when mentioning an event that is followed immediately by another event.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.