if (dlg.getDesktop().getWebApp().getConfiguration().isEventThreadEnabled()) {
try {
dlg.doModal();
} catch (Throwable ex) {
try {
dlg.detach();
} catch (Throwable ex2) {
log.warningBriefly("Failed to detach when recovering from an error", ex2);
}
if (ex instanceof InterruptedException)
throw (InterruptedException)ex;