private static HoundException CastException(Exception exception) { HoundException houndException = exception as HoundException; if (houndException == null) { houndException = new HoundException(exception); } return(houndException); }
public static HoundResult LogException(string apiKey, Exception exception) { try { HoundException houndException = CastException(exception); return(Task.Run(async() => await Log(apiKey).Publish(houndException)).Result); } catch (Exception ex) { return(HoundResultMapper.GetFailureResponse(ex)); } }
public async Task <HoundResult> Publish(HoundException exception, IEnumerable <string> tags = null) { HoundEvent houndEvent = new HoundEvent { AggregationKey = exception.GetType().FullName, AlertType = exception.Severity, Host = exception.HostName, Text = exception.ToString(), Title = exception.Message, Tags = tags ?? new List <string>() }; return(await _eventDestination.Publish(houndEvent)); }