The first thing to do is take a breath and calm the situation down and work together to figure out how to proceed. I personally always say "We can fix this" "We'll figure it out together" and then step by step figure out what the problem is, a solution that gets the task at hand done and keeps everyone happy in the end.