Can’t seem to get my code to ignore an exception. I understand that this is generally not good practice, but in this case we have some records stuck in our IntQueIn table that shouldn’t be there. Proof is that some records do not show up in the Integrated Table Workbench. I’m trying to develop a solution that sends email to different areas of the business so they can correct these rather than IT. (IT should make the change, after the business advises what went wrong)
When I call the method ProcessIntQueIn i can’t seem to ignore the exception that is raised from it. Generic try catch, catch with the specific exception, or anything. I want my code to continue to add the error messages to my grid regardless if the method fails.
private void ebtGetErrors_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
IntgWorkbenchAdapter ma = new IntgWorkbenchAdapter(oTrans);
ma.BOConnect();
for (int i = 0; i < eugData.Rows.Count; i++)
{
try
{
if (eugData.Rows[i].Cells["IntQueIn_IntError"].Value.ToString() == "True")
{
ma.ProcessIntQueIn(Int32.Parse(eugData.Rows[i].Cells["IntQueIn_IntQueID"].Value.ToString()), eugData.Rows[i].Cells["IntQueIn_RelatedToFile"].Value.ToString(), eugData.Rows[i].Cells["IntQueIn_ExtSystemID"].Value.ToString(), true, false);
eugData.Rows[i].Cells["Error"].Value = ma.GenericIMDataSet.IntgValidationError.Rows[i]["ErrorMessage"].ToString();
}
eugData.Refresh();
}
catch (Exception)
{
//do nothing
}
}
ma.Dispose();
}
Error I receive using the bl tester
TargetInvocationException
Inner Exception:
Object reference not set to an instance of an object.
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.IntgWorkbenchImpl.GetIMRecord(String ipRelatedToFile, Int32 pIntQueID, Guid gSysRowID, GenericIMDataSet ttGenericIMTablesetDS)