Skip to content

Commit cdf8b51

Browse files
Output closing
1 parent 05ffbde commit cdf8b51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/main/java/dev/vml/es/acm/core/code/ExecutionHistory.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ private void saveFileOutput(FileOutput output, Resource entry) {
9191
"Output '%s' cannot be flushed before saving to the execution history!", output.getName()),
9292
e);
9393
}
94-
file.saveFile(output.getMimeType(), output.getInputStream());
94+
try (InputStream inputStream = output.getInputStream()) {
95+
file.saveFile(output.getMimeType(), inputStream);
96+
} catch (IOException e) {
97+
throw new AcmException(
98+
String.format("Output '%s' cannot be saved to the execution history!", output.getName()), e);
99+
}
95100
}
96101

97102
public InputStream readOutputByName(Execution execution, String name) {

0 commit comments

Comments
 (0)