Fix for galloping exceptions on Sandbox

This commit is contained in:
Rick Falkvinge
2014-10-21 13:56:36 +02:00
parent 276a0a696e
commit 5ae3c4b1f7
2 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -30,8 +30,18 @@ namespace Swarmops.Utility.Communications
// This is a rather simple mail (no images or stuff like that)
mail.From = new MailAddress(comm[CommRenderPart.SenderMail], comm[CommRenderPart.SenderName], Encoding.UTF8);
mail.To.Add(new MailAddress(person.Mail, person.Name));
try
{
mail.From = new MailAddress(comm[CommRenderPart.SenderMail], comm[CommRenderPart.SenderName], Encoding.UTF8);
mail.To.Add(new MailAddress(person.Mail, person.Name));
}
catch (ArgumentException e)
{
// Address failure -- either sender or recipient
_cacheReloadTime = DateTime.MinValue;
throw new OutboundCommTransmitException("Cannot send mail to " + person.Mail, e);
}
mail.Subject = comm[CommRenderPart.Subject];
mail.Body = comm[CommRenderPart.BodyText];
+1 -1
View File
@@ -17,7 +17,7 @@ namespace Swarmops.Utility
{
try
{
SwarmDb.GetDatabaseForWriting().CreateExceptionLogEntry(DateTime.Now, "ExceptionMail", e);
SwarmDb.GetDatabaseForWriting().CreateExceptionLogEntry(DateTime.UtcNow, "ExceptionMail", e);
}
catch
{