From 4011f59721c662d99ef475e8bc5dbc1f0551bd41 Mon Sep 17 00:00:00 2001 From: Jeanette Clark Date: Wed, 18 Oct 2023 10:36:15 -0700 Subject: [PATCH] catch JepException and throw it as metadigexception --- .../ucsb/nceas/mdqengine/dispatch/Dispatcher.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/edu/ucsb/nceas/mdqengine/dispatch/Dispatcher.java b/src/main/java/edu/ucsb/nceas/mdqengine/dispatch/Dispatcher.java index be882fe8..11b712de 100644 --- a/src/main/java/edu/ucsb/nceas/mdqengine/dispatch/Dispatcher.java +++ b/src/main/java/edu/ucsb/nceas/mdqengine/dispatch/Dispatcher.java @@ -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; @@ -272,7 +273,7 @@ public void setBindings(Map 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"); @@ -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); + } + } } \ No newline at end of file