From cef772c18787ce42860379d03e2d5ca7ec3e8430 Mon Sep 17 00:00:00 2001 From: schuemie Date: Tue, 23 Feb 2016 14:26:56 +0100 Subject: [PATCH] Show message when error occurs during building of index --- src/org/ohdsi/usagi/indexBuilding/BuildIndex.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/org/ohdsi/usagi/indexBuilding/BuildIndex.java b/src/org/ohdsi/usagi/indexBuilding/BuildIndex.java index 1147584..b98755e 100644 --- a/src/org/ohdsi/usagi/indexBuilding/BuildIndex.java +++ b/src/org/ohdsi/usagi/indexBuilding/BuildIndex.java @@ -34,6 +34,7 @@ import org.ohdsi.usagi.TargetConcept; import org.ohdsi.usagi.UsagiSearchEngine; import org.ohdsi.usagi.ui.Global; +import org.ohdsi.utilities.StringUtilities; import org.ohdsi.utilities.files.FileSorter; import org.ohdsi.utilities.files.MultiRowIterator; import org.ohdsi.utilities.files.WriteTextFile; @@ -114,6 +115,7 @@ private void report(String message) { public void run() { // Load LOINC information into memory if user wants to include it in the index: + try { Map loincToInfo = null; if (loincFile != null) { report("Loading LOINC additional information"); @@ -195,6 +197,13 @@ public void run() { saveSorted(domainIds, Global.folder + "/DomainIds.txt"); if (dialog != null) dialog.setVisible(false); + } catch (Exception e){ + if (Global.frame != null) + JOptionPane.showMessageDialog(Global.frame, StringUtilities.wordWrap(e.getLocalizedMessage(), 80), "Error", JOptionPane.ERROR_MESSAGE); + e.printStackTrace(); + if (dialog != null) + dialog.setVisible(false); + } } private void saveSorted(Set set, String fileName) {