Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grad2-2602 logs are introduced #750

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public ResponseEntity<byte[]> getStudentTranscriptReport(@RequestBody ReportRequ
byte[] resultBinary = reportService.getStudentTranscriptReport(report);
return handleBinaryResponse(resultBinary, reportFile);
} catch (Exception e) {
logger.debug("ReportController" + e.getMessage());
return getInternalServerErrorResponse(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public byte[] getStudentTranscriptReport(ReportRequest reportRequest) {
StudentTranscriptReport report = getStudentTranscriptReportDocument(reportRequest);
response = report.getReportData();
} catch (Exception e) {
log.debug("getStudentTranscriptReport" + e.getMessage());
throw new ReportApiServiceException(String.format(EXCEPTION_MSG, methodName), e);
}
log.debug(DEBUG_LOG_PATTERN, methodName, CLASS_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private synchronized StudentTranscriptReport createReport(
final GraduationData graduationData) throws DomainServiceException, IOException {
final String methodName = "createReport(...)";
LOG.entering(CLASSNAME, methodName);

try {
final TranscriptTypeCode transcriptTypeCode = transcript.getTranscriptTypeCode();

final TranscriptReport report = reportService.createTranscriptReport(transcriptTypeCode, program);
Expand Down Expand Up @@ -567,6 +567,15 @@ private synchronized StudentTranscriptReport createReport(
LOG.exiting(CLASSNAME, methodName);
return transcriptReport;
}
catch (DomainServiceException | IOException e) {
LOG.log(Level.INFO, "Error occurred in " + methodName, e.getMessage());
throw e; // Rethrow to maintain method signature behavior
} catch (Exception e) {
LOG.log(Level.INFO, "Unexpected error occurred in " + methodName, e.getMessage());
throw new RuntimeException("Unexpected error occurred while generating the student transcript report", e);
}

}

@Override
@RolesAllowed({FULFILLMENT_SERVICES_USER})
Expand All @@ -592,6 +601,7 @@ private StudentTranscriptReport getStudentTranscriptReport(
final Parameters<String, Object> parameters) throws DomainServiceException, IOException {
final String methodName = "getStudentTranscriptReport(String, ReportFormat, boolean, Parameters)";
LOG.entering(CLASSNAME, methodName);
try {
final String pen = personalEducationNumber.getValue();
final StudentInfo studentInfo = getStudentInfo(pen);

Expand All @@ -612,11 +622,11 @@ private StudentTranscriptReport getStudentTranscriptReport(

Date issueDate = transcript.getIssueDate();

if(preview && StringUtils.isNotBlank(personalEducationNumber.getEntityId())) {
if (preview && StringUtils.isNotBlank(personalEducationNumber.getEntityId())) {
LOG.log(Level.FINE, "Preview transcript get Last Update Date");
UUID graduationStudentRecordId = UUID.fromString(personalEducationNumber.getEntityId());
Optional<Date> transcriptLastUpdateDate = studentTranscriptRepository.getTranscriptLastUpdateDate(graduationStudentRecordId);
if(transcriptLastUpdateDate.isPresent()) {
if (transcriptLastUpdateDate.isPresent()) {
issueDate = transcriptLastUpdateDate.get();
}
}
Expand All @@ -639,6 +649,14 @@ private StudentTranscriptReport getStudentTranscriptReport(
LOG.exiting(CLASSNAME, methodName);
return report;
}
catch (DomainServiceException | IOException e) {
LOG.log(Level.INFO, "Error occurred in " + methodName, e.getMessage());
throw e;
} catch (Exception e) {
LOG.log(Level.INFO, "Unexpected error occurred in " + methodName, e.getMessage());
throw new RuntimeException("Unexpected error occurred while generating the student transcript report", e);
}
}

private String getCreditsUsedForGrad(final Transcript transcript) {
final List<TranscriptResult> results = transcript.getResults();
Expand Down
Loading