mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-01-22 17:22:15 +00:00
crash on failure
This commit is contained in:
parent
0d73c49fed
commit
e19487b1a1
1 changed files with 17 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
using System.Net;
|
||||
using System.Net.Mail;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Microsoft.AspNet.Identity;
|
||||
|
@ -42,6 +43,22 @@ public Task SendAsync(IdentityMessage msg)
|
|||
};
|
||||
|
||||
var result = reachmail.Easysmtp.Post(request);
|
||||
if (result.Failures)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("A fatal exception has occurred in the Unite mail backend.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Basically, we couldn't send messages to the following addresses: ");
|
||||
|
||||
foreach(var addr in result.FailedAddresses)
|
||||
{
|
||||
sb.AppendLine(" - " + addr.Email);
|
||||
sb.AppendLine(" - Reason: " + addr.Reason);
|
||||
}
|
||||
sb.AppendLine("FUCKING CONTACT MICHAEL. NOW.");
|
||||
string exc = sb.ToString();
|
||||
throw new Exception(exc);
|
||||
}
|
||||
return Task.FromResult<DeliveryResponse>(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue