Need to create appEvents for Error

Hi ,So in my code whenever the control flow enters the catch block(try-catch) I want to display the error message in the following format


What package and how should I be using for this?