helper method for post and comment errors