Un-commented code to handle some dBase errors

This commit is contained in:
Rich 2010-03-25 19:25:17 +00:00
parent df1a2a1d47
commit 01ca268595

View File

@ -522,33 +522,30 @@ namespace DataLoader
catch (Exception ex) catch (Exception ex)
{ {
//FileInfo fi; FileInfo fi;
//switch (ex.Message) switch (ex.Message)
//{ {
// case "Index file not found.":// then delete inf file case "Index file not found.":// then delete inf file
// fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf"); fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".inf");
// fi.Delete(); fi.Delete();
// LoadSection(ds, da, FileName);// Try Again LoadSection(ds, da, FileName);// Try Again
// break; break;
// case "External table is not in the expected format.": // then pad dbt file with 128 zeros. case "External table is not in the expected format.": // then pad dbt file with 128 zeros.
// fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt"); fi = new FileInfo(frmMain.tbSourceText + "\\" + FileName + ".dbt");
// FileStream fs = fi.OpenWrite(); FileStream fs = fi.OpenWrite();
// fs.Position = fs.Length; fs.Position = fs.Length;
// byte[] buf = new byte[128]; byte[] buf = new byte[128];
// for (int i = 0; i < 128; i++) buf[i] = 0; for (int i = 0; i < 128; i++) buf[i] = 0;
// fs.Write(buf, 0, 128); fs.Write(buf, 0, 128);
// fs.Close(); fs.Close();
// LoadSection(ds, da, FileName);// Try Again LoadSection(ds, da, FileName);// Try Again
// break; break;
// default: // Unrecognized error default: // Unrecognized error
// frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName); frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName);
// Console.WriteLine("Unrecognized error: error = {0}", ex.Message); Console.WriteLine("Unrecognized error: error = {0}", ex.Message);
// log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException); log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException);
// break; break;
//} }
frmMain.AddError(ex, "Unrecognized error in LoadSection {0}", FileName);
Console.WriteLine("Unrecognized error: error = {0}", ex.Message);
log.ErrorFormat("File - {0}.DBF\r\n\r\n{1}\r\n\r\n{2}", FileName, ex.Message, ex.InnerException);
} }
} }
} }