mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
don't email for deployment-interrupted snapshot exceptions
This commit is contained in:
parent
a646854695
commit
f836b39da0
1 changed files with 14 additions and 8 deletions
|
|
@ -182,16 +182,22 @@ private async Task TrackException(Exception e)
|
|||
|
||||
private async Task SendExceptionEmail(Exception e)
|
||||
{
|
||||
var msg = new StringBuilder();
|
||||
msg.AppendLine("FilterListId: " + list.Id);
|
||||
msg.AppendLine("Exception:");
|
||||
msg.AppendLine(e.Message);
|
||||
msg.AppendLine(e.StackTrace);
|
||||
msg.AppendLine(e.InnerException?.Message);
|
||||
msg.AppendLine(e.InnerException?.StackTrace);
|
||||
await emailService.SendEmailAsync("Snapshot Exception", msg.ToString());
|
||||
if (!IsDeploymentInterrupted(e))
|
||||
{
|
||||
var msg = new StringBuilder();
|
||||
msg.AppendLine("FilterListId: " + list.Id);
|
||||
msg.AppendLine("Exception:");
|
||||
msg.AppendLine(e.Message);
|
||||
msg.AppendLine(e.StackTrace);
|
||||
msg.AppendLine(e.InnerException?.Message);
|
||||
msg.AppendLine(e.InnerException?.StackTrace);
|
||||
await emailService.SendEmailAsync("Snapshot Exception", msg.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsDeploymentInterrupted(Exception e) =>
|
||||
e.Message.Contains("Failed to read the result set.");
|
||||
|
||||
private void TrackExceptionInApplicationInsights(Exception e)
|
||||
{
|
||||
telemetryClient.TrackException(e);
|
||||
|
|
|
|||
Loading…
Reference in a new issue