Skip to content

Commit

Permalink
Merge pull request #706 from bcgov/yj
Browse files Browse the repository at this point in the history
fix: handle system error
  • Loading branch information
ychung-mot authored Oct 16, 2024
2 parents fd91fe0 + 5d97f88 commit 04c4b25
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions server/StrDss.Service/BizLicenceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ private async Task ProcessBizLicenceUploadSubAsync(DssUploadDelivery upload)

private async Task<(string orgCd, string sourceRecordNo)> ProcessLine(DssUploadDelivery upload, string header, DssUploadLine line, CsvReader csvReader)
{
var systemError = "";

csvReader.Read();

csvReader.ReadHeader();
Expand All @@ -132,9 +134,16 @@ private async Task ProcessBizLicenceUploadSubAsync(DssUploadDelivery upload)

row.LicenceStatusType = row.LicenceStatusType.IsEmpty() ? "ISSUED" : row.LicenceStatusType;

await _bizLicenceRepo.InsertRowToBizLicTempTable(row, org.OrganizationId);
try
{
await _bizLicenceRepo.InsertRowToBizLicTempTable(row, org.OrganizationId);
}
catch (Exception ex)
{
systemError = ex.Message;
}

SaveUploadLine(line, errors, false, "");
SaveUploadLine(line, errors, false, systemError);

return (row.OrgCd, row.BusinessLicenceNo);
}
Expand Down

0 comments on commit 04c4b25

Please sign in to comment.