Skip to content

Commit 9951a8d

Browse files
committed
Preparation for branching
1 parent 1f2ed4d commit 9951a8d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

mappingservice-plugin/src/main/java/edu/kit/datamanager/semplugin/SEMImagePlugin.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package edu.kit.datamanager.semplugin;
22

3+
import edu.kit.datamanager.mappingservice.exception.PluginInitializationFailedException;
34
import edu.kit.datamanager.mappingservice.plugins.*;
45
import edu.kit.datamanager.mappingservice.util.*;
56
import org.slf4j.Logger;
@@ -53,7 +54,7 @@ public SEMImagePlugin() {
5354
}
5455

5556
} catch (IOException e) {
56-
e.printStackTrace();
57+
throw new PluginInitializationFailedException("Failed to instantiate plugin class.", e);
5758
}
5859
}
5960

@@ -95,18 +96,15 @@ public void setup() {
9596
LOGGER.info("Cloning git repository {}, Tag {}", REPOSITORY, TAG);
9697
dir = FileUtil.cloneGitRepository(REPOSITORY, TAG);
9798
// Install Python dependencies
98-
9999
MappingPluginState venvState = PythonRunnerUtil.runPythonScript("-m", "venv", "--system-site-packages", dir + "/" + pluginVenv);
100100
if (MappingPluginState.SUCCESS().getState().equals(venvState.getState())) {
101-
LOGGER.info("Venv for plugin installed successfully.");
102-
LOGGER.info("Installing packages");
101+
LOGGER.info("Venv for plugin installed successfully. Installing packages.");
103102
ShellRunnerUtil.run(dir + "/" + venvInterpreter, "-m", "pip", "install", "-r", dir + "/" + "requirements.dist.txt");
104103
} else {
105-
LOGGER.error("venv installation was not successful");
104+
throw new PluginInitializationFailedException("Venv installation was not successful. Status: " + venvState.getState());
106105
}
107-
108-
} catch (Exception e) {
109-
e.printStackTrace();
106+
} catch (MappingPluginException e) {
107+
throw new PluginInitializationFailedException("Unexpected error during plugin setup.", e);
110108
}
111109
}
112110

0 commit comments

Comments
 (0)