I'd probably say something like: “Ha! Let's see what's going on here…” and try to troubleshoot and debug it right then. If I can't find the cause right away, or the first couple of fix ideas don't immediately make it work, I'd then stop trying to debug it and show them the parts of the code that do stuff and describe the desired result to them in words rather than showing them.
Sometimes the smallest mistakes, like a file being named wrong or a missing semicolon, can break a whole demo. People understand this. It happens to everybody sometimes, just try not to let it happen too many times or people will think you're sloppier than average ;)
Whatever you do—don't punish yourself or call yourself stupid in front of another person, they'll believe you! Everybody makes mistakes, accept your mistakes with grace when you make them, you're not stupid if something has a bug!