SignalR intercept every incoming message (client side)

I have a question regarding SignalR on the clientside (JS). Is there a way to intercept incoming messages at the clientside? I am working on a chat application with a lot traffic on the socket. I want to be able to execute code (catch errors if any) on every incoming event. Looking at the docs i can’t find any existing solution for this. Is there anyone that knows a solution for this?

Thanks in advance. Any help would be much appreciated!