Sorry this happened to you. It's not very nice.

For me, I'd just learn from it. Someone that you told can't be that good a friend not to respect your confidence.

This time I had someone tell my boss before I did. Bad karma. Lesson learnt the hard way.