This verse could be taken as an isolated warning against anger which bears no relation to the verses around and it is anyone’s guess about what might have triggered that anger. But the context is human responses to the gospel.
If you feel that anger rising, suppress it. You must hear some hard things in order to obtain salvation and there is no avoiding this. God will not receive us without repentance and there is no repentance without the conviction and shame that results from having our sins exposed. It is an anger that originates in pride. When the sinner hears the preaching of the gospel, he may harden his heart in anger, ‘Why should I have to put up with these things’, or he may humble himself and accept the truth of what is said. This humbling is so difficult and so contrary to our natural inclinations that only God can bring it about, but we must desire it and strive for it, or we will never obtain it. God never works salvation in human hearts without our being involved and from our perspective, it may seem as if we are the only ones fighting for our eternal souls. The reality is that verses like this are brought to bear on us and the Spirit so applies them to us that we are made willing and motivated to do what is right. If we are ever to find this glorious salvation, then we must overcome this angry response and see it for the foolishness that it is, something that is directed against our best interests.
Don’t be frustrated when you hear this message. All these verses are talking about needing God and responding to him. Don’t burst out at God: ‘Go away, I am offended at being called a sinner, at losing the government of my life.’ Anger is sitting there, waiting to produce a bad response in us. Think about your need of eternity, and then you will listen.