Which exception to show alert in ui

Hi Guys, i’ve developed some new provider extending the different spis but there is one thing that i can’t do, it is showing an error in the UI with an alert.
Is it an exception to throw ? If it is i can’t find it.
If not, what is it ?

Thanks guys.