private void ProcessInputQueueEntry(long parentNodeId, ExperianInputQueue eiq, UserInfo uinf)
{
try
{
logger.InfoFormat("Processing InputQueue entry: {0}, Major: {1}, Minor: {2}", eiq.Id, eiq.MajorType,
eiq.MinorType);
var parser = ExperianInputXMLParserFactory.Construct(eiq);
switch (eiq.MajorType)
{
case InputMajorType.ReportCases:
switch (eiq.MinorType)
{
case 1:
CreateNewRegistration((ExperianReportCase)parser.GetObject(), parentNodeId, uinf);
break;
case 2:
DeleteRegistration(parser, uinf);
break;
case 3:
MoveToSolicitor(parser, parentNodeId, uinf);
break;
case 4:
MoveToClient(parser, parentNodeId, uinf);
break;
case 5:
Reopen(parser, parentNodeId, uinf);
break;
case 6:
MoveToPublicService(parser, parentNodeId, uinf);
break;
}
break;
case InputMajorType.Cpr:
switch (eiq.MinorType)
{
case 1:
DeleteRegistrationsFromCpr(eiq.IdCardNo, uinf);
break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
try
{
HandleCPRStatusUpdateOtherThanDeath(eiq.IdCardNo, uinf, eiq.MinorType);
}
catch (Exception exception)
{
logger.ErrorFormat("An error occurred while updating the cpr status for the InputQueue task for eiq ID = {0} -- stacktrace ---> {1}", eiq.Id, exception);
throw exception;
}
break;
}
break;
case InputMajorType.CustomerDeletion:
switch (eiq.MinorType)
{
case 1:
DeleteRegistrationsByCustomer(eiq.ExperianCustomerNumber, uinf);
break;
}
break;
case InputMajorType.IdCardCombined:
switch (eiq.MinorType)
{
case 1:
CombineIdCards(parser, parentNodeId, uinf);
break;
}
break;
case InputMajorType.Document:
switch (eiq.MinorType)
{
case 1:
AddDocumentToNode(parser, eiq.NodeId, eiq.Data, uinf);
break;
case 2:
AddDocumentToFeedbackDossierNode(parser, eiq.NodeId, uinf);
break;
}
break;
case InputMajorType.CustomerContractTerminated:
if (eiq.MinorType == 1)
{
HandleCustomerContractTermination(eiq.ExperianCustomerNumber, uinf);
}
break;
default:
break;
}
eiq.Status = 1;
UpdateInputQueueItem(eiq, uinf);
}
catch (Exception ex)
{
logger.ErrorFormat("Error while executing EsdhInputQueue task for eiq ID = {0} -- stacktrace ---> {1}", eiq.Id, ex);
eiq.Status = 0;
EventLog.WriteEntry("Task Scheduler", "An Error has occured while processing the input queue case", EventLogEntryType.Error, 2);
UpdateInputQueueItem(eiq, uinf);
}
}
My code is listed above....In the last catch block....I need to add a logic to handle if there is any database connective issue or any network access issue (Like the data cannot be fetched or some issue with databse from the server side) and make the corresponding status as 1 so that it can be picked later for processing.How can I go about adding this as a if statement in the ending catch block.