['A friend of mine spent all night partying instead of staying home to study. He ended up failing an important exam!']
That is no good.  I bet he regrets it!
Just found out my friend failed an important exam because he was out partying the night before and didn't get much sleep.