Skip to content

Commit

Permalink
Merge pull request #52 from pagopa/PRDP-176-add-alert
Browse files Browse the repository at this point in the history
[PRDP-176] chore: Update logs for alert
  • Loading branch information
pasqualespica authored Oct 23, 2023
2 parents 8401341 + b05ee98 commit 5cc463b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private PdfMetadata generateAndSavePDFReceipt(BizEvent bizEvent, String template
PdfEngineResponse pdfEngineResponse = generatePDFReceipt(template, workingDirPath);
return saveToBlobStorage(pdfEngineResponse, blobName);
} catch (PDFReceiptGenerationException e) {
logger.error("An error occurred when generating or saving the PDF receipt for biz-event {}", bizEvent.getId(), e);
logger.error("An error occurred when generating or saving the PDF receipt for biz-event {}. Error: {}", bizEvent.getId(), e.getMessage(), e);
return PdfMetadata.builder().statusCode(e.getStatusCode()).errorMessage(e.getMessage()).build();
}
}
Expand Down Expand Up @@ -204,7 +204,8 @@ private PdfEngineResponse generatePDFReceipt(ReceiptPDFTemplate template, Path w
PdfEngineResponse pdfEngineResponse = pdfEngineClient.generatePDF(request, workingDirPath);

if (pdfEngineResponse.getStatusCode() != HttpStatus.SC_OK) {
throw new GeneratePDFException(pdfEngineResponse.getErrorMessage(), pdfEngineResponse.getStatusCode());
String errMsg = String.format("PDF-Engine response KO (%s): %s", pdfEngineResponse.getStatusCode(), pdfEngineResponse.getErrorMessage());
throw new GeneratePDFException(errMsg, pdfEngineResponse.getStatusCode());
}

return pdfEngineResponse;
Expand Down

0 comments on commit 5cc463b

Please sign in to comment.