Skip to content

Commit 979f446

Browse files
committed
add more information to errors
1 parent 84c98d2 commit 979f446

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/io/bioimage/modelrunner/tensorflow/v1/Tensorflow1Interface.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,11 @@ private void launchModelLoadOnProcess() throws IOException, InterruptedException
220220
if (task.status == TaskStatus.CANCELED)
221221
throw new RuntimeException();
222222
else if (task.status == TaskStatus.FAILED)
223-
throw new RuntimeException();
223+
throw new RuntimeException(task.error);
224224
else if (task.status == TaskStatus.CRASHED) {
225225
this.runner.close();
226226
runner = null;
227-
throw new RuntimeException();
227+
throw new RuntimeException(task.error);
228228
}
229229
}
230230

@@ -380,11 +380,11 @@ void runInterprocessing(List<Tensor<T>> inputTensors, List<Tensor<R>> outputTens
380380
if (task.status == TaskStatus.CANCELED)
381381
throw new RuntimeException();
382382
else if (task.status == TaskStatus.FAILED)
383-
throw new RuntimeException();
383+
throw new RuntimeException(task.error);
384384
else if (task.status == TaskStatus.CRASHED) {
385385
this.runner.close();
386386
runner = null;
387-
throw new RuntimeException();
387+
throw new RuntimeException(task.error);
388388
}
389389
for (int i = 0; i < outputTensors.size(); i ++) {
390390
String name = (String) Types.decode(encOuts.get(i)).get(MEM_NAME_KEY);
@@ -508,11 +508,11 @@ public void closeModel() {
508508
if (task.status == TaskStatus.CANCELED)
509509
throw new RuntimeException();
510510
else if (task.status == TaskStatus.FAILED)
511-
throw new RuntimeException();
511+
throw new RuntimeException(task.error);
512512
else if (task.status == TaskStatus.CRASHED) {
513513
this.runner.close();
514514
runner = null;
515-
throw new RuntimeException();
515+
throw new RuntimeException(task.error);
516516
}
517517
this.runner.close();
518518
this.runner = null;

0 commit comments

Comments
 (0)