Added conditions when run custom Exception Listener, optimize code for ChatMessageController and UserController