Skip to content

Commit cb68520

Browse files
committed
add more information to errors
1 parent d366c11 commit cb68520

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: src/main/java/io/bioimage/modelrunner/tensorflow/v2/api020/Tensorflow2Interface.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ private void launchModelLoadOnProcess() throws IOException, InterruptedException
211211
if (task.status == TaskStatus.CANCELED)
212212
throw new RuntimeException();
213213
else if (task.status == TaskStatus.FAILED)
214-
throw new RuntimeException();
214+
throw new RuntimeException(task.error);
215215
else if (task.status == TaskStatus.CRASHED) {
216216
this.runner.close();
217217
runner = null;
218-
throw new RuntimeException();
218+
throw new RuntimeException(task.error);
219219
}
220220
}
221221

@@ -371,11 +371,11 @@ void runInterprocessing(List<Tensor<T>> inputTensors, List<Tensor<R>> outputTens
371371
if (task.status == TaskStatus.CANCELED)
372372
throw new RuntimeException();
373373
else if (task.status == TaskStatus.FAILED)
374-
throw new RuntimeException();
374+
throw new RuntimeException(task.error);
375375
else if (task.status == TaskStatus.CRASHED) {
376376
this.runner.close();
377377
runner = null;
378-
throw new RuntimeException();
378+
throw new RuntimeException(task.error);
379379
}
380380
for (int i = 0; i < outputTensors.size(); i ++) {
381381
String name = (String) Types.decode(encOuts.get(i)).get(MEM_NAME_KEY);
@@ -496,11 +496,11 @@ public void closeModel() {
496496
if (task.status == TaskStatus.CANCELED)
497497
throw new RuntimeException();
498498
else if (task.status == TaskStatus.FAILED)
499-
throw new RuntimeException();
499+
throw new RuntimeException(task.error);
500500
else if (task.status == TaskStatus.CRASHED) {
501501
this.runner.close();
502502
runner = null;
503-
throw new RuntimeException();
503+
throw new RuntimeException(task.error);
504504
}
505505
this.runner.close();
506506
this.runner = null;

0 commit comments

Comments
 (0)