Skip to content

Commit

Permalink
add more information to errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Dec 20, 2024
1 parent cb2a417 commit 4818559
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ private void launchModelLoadOnProcess() throws IOException, InterruptedException
if (task.status == TaskStatus.CANCELED)
throw new RuntimeException();
else if (task.status == TaskStatus.FAILED)
throw new RuntimeException();
throw new RuntimeException(task.error);
else if (task.status == TaskStatus.CRASHED) {
this.runner.close();
runner = null;
throw new RuntimeException();
throw new RuntimeException(task.error);
}
}

Expand Down Expand Up @@ -363,11 +363,11 @@ void runInterprocessing(List<Tensor<T>> inputTensors, List<Tensor<R>> outputTens
if (task.status == TaskStatus.CANCELED)
throw new RuntimeException();
else if (task.status == TaskStatus.FAILED)
throw new RuntimeException();
throw new RuntimeException(task.error);
else if (task.status == TaskStatus.CRASHED) {
this.runner.close();
runner = null;
throw new RuntimeException();
throw new RuntimeException(task.error);
}
for (int i = 0; i < outputTensors.size(); i ++) {
String name = (String) Types.decode(encOuts.get(i)).get(MEM_NAME_KEY);
Expand Down Expand Up @@ -487,11 +487,11 @@ public void closeModel() {
if (task.status == TaskStatus.CANCELED)
throw new RuntimeException();
else if (task.status == TaskStatus.FAILED)
throw new RuntimeException();
throw new RuntimeException(task.error);
else if (task.status == TaskStatus.CRASHED) {
this.runner.close();
runner = null;
throw new RuntimeException();
throw new RuntimeException(task.error);
}
this.runner.close();
this.runner = null;
Expand Down

0 comments on commit 4818559

Please sign in to comment.