I'm curious whether you are male or female. As a male, I wouldn't want a hug from either a male or female under those circumstances. From a male, it would seem gay. From a female, it would make me feel emasculated. What I would have liked most in that situation was a male whom I respected to say, "Hey, man, you didn't deserve that. How about joining me for a beer after work."
I am a woman; and I keenly felt at that moment that he would have welcomed a hug.