An (almost) embarrassing moment

My boyfriend and I were having some mind blowing sex. I was riding him and doing my thing and he started rubbing my clit but I almost peed?! I made sure to go to the bathroom before we did it caus it happened last night too. I know I wasn't gonna cum cause it didn't feel like that but I almost died. It felt so good so I don't know what that was. Someone mind explaining?