Skip to content

Commit

Permalink
Show message when error occurs during building of index
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Feb 23, 2016
1 parent e92ec40 commit cef772c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/org/ohdsi/usagi/indexBuilding/BuildIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, String> loincToInfo = null;
if (loincFile != null) {
report("Loading LOINC additional information");
Expand Down Expand Up @@ -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<String> set, String fileName) {
Expand Down

0 comments on commit cef772c

Please sign in to comment.