Added Error Handling and Reporting

This commit is contained in:
Rich
2009-11-04 17:15:29 +00:00
parent cd04644e2f
commit f26cc50c3c
13 changed files with 265 additions and 86 deletions

View File

@@ -78,7 +78,7 @@ namespace DataLoader
// if need landscape set too: bool landscape = (stype[1] == 'L');
d.SetLineSpacing(lpi); // if need landscape set too: , landscape); ;
}
string temppath = Path.GetTempFileName();
//string temppath = Path.GetTempFileName();
/* 16-bit's type[1] used the following codes to represent the respective lpi setting
*
* char far typestr[] = "*pP46f7L";
@@ -118,7 +118,8 @@ namespace DataLoader
}
}
else
log.ErrorFormat("Missing rtf file: {0}", fname);
//log.ErrorFormat("Missing rtf file: {0}", fname);
frmMain.AddError("Missing rtf file: {0}", fname);
return docid;
}
private int SaveWordDoc(string temppath, string stype)
@@ -150,6 +151,7 @@ namespace DataLoader
catch (IOException exio)
{
Console.WriteLine("IO: {0} - {1}", exio.GetType().Name, exio.Message);
frmMain.AddError(exio, "SaveTheDoc('{0}','{1}')", temppath, title);
Wait(2);
return 0;
}
@@ -157,6 +159,7 @@ namespace DataLoader
{
log.Error("Save Word Doc");
log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException);
frmMain.AddError(ex, "SaveTheDoc('{0}','{1}')", temppath, title);
return -1;
}
@@ -173,4 +176,4 @@ namespace DataLoader
return done;
}
}
}
}