When I get frustrated, I typically put the irritating piece away and play something really easy and fun for a while, until I calm down. Or, if I’m super upset, I’ll just take a break and walk away until I feel like I can face my instrument. 🙂 I always drink a glass of water when this happens. I don’t know why, it just makes me feel better somehow.
Here’s a good article on making practice less boring, though some of the tips would work for frustration, too!