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 84c98d2 commit 979f446
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,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 @@ -380,11 +380,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 @@ -508,11 +508,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 979f446

Please sign in to comment.