Esempio n. 1
0
        private static HoundException CastException(Exception exception)
        {
            HoundException houndException = exception as HoundException;

            if (houndException == null)
            {
                houndException = new HoundException(exception);
            }

            return(houndException);
        }
Esempio n. 2
0
 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));
     }
 }
Esempio n. 3
0
        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));
        }