失敗したときにログを削除してリカバリするように

This commit is contained in:
r-ca 2024-01-24 18:36:08 +09:00
parent 113bca723f
commit 6b3d0c0dae
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -76,16 +76,22 @@ public class DocumentProcessorImpl implements DocumentProcessor{
lacertaVcs.insertPage(this.documentDetail.getPages().size(), filename); lacertaVcs.insertPage(this.documentDetail.getPages().size(), filename);
Page page = new Page(); try {
page.setFileName(filename); Page page = new Page();
page.setBitmap(bitmap); page.setFileName(filename);
this.documentDetail.getPages().add(page); page.setBitmap(bitmap);
this.documentDetail.getPages().add(page);
this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename); this.fileManager.getNewInstance().createDirectoryIfNotExist(DEFAULT_SAVE_DIR).resolve(DEFAULT_SAVE_DIR).saveBitmap(bitmap, filename);
logger.info("addNewPageToLast", "finished");
logger.info("addNewPageToLast", "filename: " + filename);
logger.info("addNewPageToLast", "finished");
logger.info("addNewPageToLast", "filename: " + filename);
} catch (Exception e) {
logger.error("addNewPageToLast", "failed: Unknown error");
logger.e_code("d9191286-6092-40b3-80ed-9239106a8c65");
// Recover (Undo latest action)
lacertaVcs.undo();
}
return this; return this;
} }