The DetailsDialog comes along with a convenient static method to display error messages. By using a null value for the title a default error title appears. By using a null value for the error message, Throwable#getMessage appears as message. The dialog is modal by default.

All relevant lines are highlighted. Press the "Run..." button to start the example.