Integrate jupyterlab UI with server

I have update jupyterlab UI with some warning message, when my custom contentsManager returns some error I want to show the error with message to frontEnd, otherwise I won’t display the message.

Is there any way that I can pass the error from server to UI and how can I control the message show or hide?