How to give a error message / warning to display on the user side?

I’m working on a dashboard project produce visual for some data in DB. I’m trying to add a warning / error message to my dashboard. Instead of have separate component for each of my current plot to pop the error message. Is there a general way or Exception available in Dash now?

The idea in my mind is something like this:
something may break
raise DashException(“A error”)

Then the error message can be linked with a callback and displayed at the user end.
Any advice would be much appreciated!