My general theory is that mistakes are always going to happen. Always, always, always. If you aren't making mistakes occasionally, then you're probably not working. Realizing this has helped me be able to look at my mistakes objectively, determine why I made them, then figure out how to prevent them in the future. Doing that calms me down a lot.
Once I worked for a manager who was feared by everyone. Physically and verbally intimidating, he would pounce on every little thing that went wrong, and people were always afraid of him, and even more afraid of messing something up. Once I accidentally damaged something. The manager walked in the room and noticed it immediately, started to get red and puffed up, and raised his voice, "Who did this?!?" I stepped forward and and said "I did." It was like the air was let out of a balloon. He was almost shocked that someone would admit a mistake. Then he straightened his tie and said, "Let's fix it." And we did.
Move forward now and keep on recognizing the good in yourelf.