Skip to content

Commit

Permalink
catch JepException and throw it as metadigexception
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanetteclark committed Oct 18, 2023
1 parent a807987 commit 4011f59
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/edu/ucsb/nceas/mdqengine/dispatch/Dispatcher.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.ucsb.nceas.mdqengine.dispatch;

import edu.ucsb.nceas.mdqengine.MDQconfig;
import edu.ucsb.nceas.mdqengine.exception.MetadigException;
import edu.ucsb.nceas.mdqengine.model.Output;
import edu.ucsb.nceas.mdqengine.model.Result;
import edu.ucsb.nceas.mdqengine.model.Status;
Expand Down Expand Up @@ -272,7 +273,7 @@ public void setBindings(Map<String, Object> bindings) {
this.bindings = bindings;
}

public static void setupJep() {
public static void setupJep() throws MetadigException {
// first look for an env var (this is mostly for local testing)
String pythonFolder = System.getenv("JEP_LIBRARY_PATH");

Expand All @@ -295,8 +296,12 @@ public static void setupJep() {
jepPath = pythonFolder + "/libjep.so";
}

// set path for jep executing python
MainInterpreter.setJepLibraryPath(jepPath);

// set path for jep executing python
try {
MainInterpreter.setJepLibraryPath(jepPath);
} catch (JepException e) {
throw new MetadigException("Error confguring Jep: " + e);
}

}
}

0 comments on commit 4011f59

Please sign in to comment.