diff options
| author | Michael <[email protected]> | 2017-05-18 13:09:52 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-18 13:09:52 -0400 |
| commit | e19487b1a1c381166b5defb8224fa05a6d93d986 (patch) | |
| tree | 7c61d1ff07e34fdcb66c5d43a0fc6a1021c4fa53 /Project-Unite/App_Start/IdentityConfig.cs | |
| parent | 0d73c49fed8f3628d0ec80e6a876d6f54df2dd63 (diff) | |
| download | project-unite-e19487b1a1c381166b5defb8224fa05a6d93d986.tar.gz project-unite-e19487b1a1c381166b5defb8224fa05a6d93d986.tar.bz2 project-unite-e19487b1a1c381166b5defb8224fa05a6d93d986.zip | |
crash on failure
Diffstat (limited to 'Project-Unite/App_Start/IdentityConfig.cs')
| -rw-r--r-- | Project-Unite/App_Start/IdentityConfig.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Project-Unite/App_Start/IdentityConfig.cs b/Project-Unite/App_Start/IdentityConfig.cs index dc36eb3..8788e97 100644 --- a/Project-Unite/App_Start/IdentityConfig.cs +++ b/Project-Unite/App_Start/IdentityConfig.cs @@ -5,6 +5,7 @@ using System.Linq; 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 @@ namespace Project_Unite }; 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); } |
