Skip to content

Commit

Permalink
shanoir-issue#2560: more logs and exception throw
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrehenri-dauvergne committed Jan 16, 2025
1 parent 80d847b commit dacc169
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,26 @@ public void createStats(String studyNameInRegExp, String studyNameOutRegExp, Str
.collect(Collectors.joining("\t"));
LOG.error("line : " + line);
writer.write(line + "\n");
writer.flush();
} catch (Exception e) {
event.setStatus(ShanoirEvent.ERROR);
event.setMessage("Error during writing of statistics.");
event.setProgress(-1f);
eventService.publishEvent(event);
LOG.error("Error during writing of statistics with id : " + event.getId());
LOG.error(e.getMessage(), e);
}
});
writer.flush();

zos.closeEntry();
LOG.error("end writing stats");
} catch (Exception e) {
event.setStatus(ShanoirEvent.ERROR);
event.setMessage("Error during writing of statistics.");
event.setProgress(-1f);
eventService.publishEvent(event);
LOG.error("Error during writing of statistics with id : " + event.getId());
LOG.error(e.getMessage(), e);
} finally {
event.setObjectId(String.valueOf(event.getId()));
event.setProgress(1f);
Expand Down

0 comments on commit dacc169

Please sign in to comment.