Skip to content

Commit

Permalink
Clearer error messages for issue #53
Browse files Browse the repository at this point in the history
  • Loading branch information
fmagin committed Dec 29, 2024
1 parent 9f2f0ca commit 3e4a870
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package GhidraJupyterKotlin;


import ghidra.util.Msg;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
Expand Down Expand Up @@ -60,8 +62,7 @@ private static String getJupyterRuntime() {

return processOutputReader.readLine().strip();
} catch (InterruptedException | IOException e) {
e.printStackTrace();
return null;
throw new RuntimeException("Could not get jupyter runtime directory, please report this issue",e);
}
}

Expand Down Expand Up @@ -92,6 +93,10 @@ private static File writeConfigFile() {
// this is not guaranteed by only invoking `jupyter --runtime-dir`
// on new machines that never did anything with jupyter the directory won't exist
// and writing the file will fail
Msg.info(ConnectionFile.class, "Trying to write Kernel file to: " + kernelFile.getAbsolutePath());
if (kernelFile.getParentFile() == null) {
throw new RuntimeException("Parent directory of kernel file %s is unexpectedly null, please report this issue".formatted(kernelFile.toString()));
}
try {
Files.createDirectories(kernelFile.getParentFile().toPath());
} catch (IOException e) {
Expand Down

0 comments on commit 3e4a870

Please sign in to comment.