added try catch

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-11-29 13:47:31 -07:00
parent 9421cb57ca
commit 8e644093f9

View File

@@ -349,6 +349,8 @@ namespace CarCareTracker.Logic
int monthMultiplier = 1;
var originalDate = recurringFee.Date;
while (isOutdated)
{
try
{
var nextDate = originalDate.AddMonths(monthInterval * monthMultiplier);
monthMultiplier++;
@@ -359,6 +361,11 @@ namespace CarCareTracker.Logic
_taxRecordDataAccess.SaveTaxRecordToVehicle(recurringFee);
isOutdated = !recurringFee.IsRecurring;
}
catch (Exception)
{
isOutdated = false; //break out of loop if something broke.
}
}
}
}
}