Pretty English I guess, an expression of complete suprise, or utter contempt at something that has passed. Similar to 'Christ on a bike', depending on the religious persuasions of assembled company.
Ie. When breaking a glass full of vodka: 'Shit the bed!'
Meaning to die or not do well at all. Stems from the fact that when someone dies or is very sick they will lose rectal sphincter tone and quite literally shit, on the bed.
Shit the bed is when someone freaks out about something and can't handle it. When you get really mad and are inconsolable. When you get really upset.
Mike shit the bed when he found out his girlfriend was cheating on him. Bob shit the bed when he saw his test score. Sally shit the bed when she didn't get a promotion.