public void CleansePacket(SonarrSentryPacket packet)
        {
            packet.Message = CleanseLogMessage.Cleanse(packet.Message);

            if (packet.Fingerprint != null)
            {
                for (var i = 0; i < packet.Fingerprint.Length; i++)
                {
                    packet.Fingerprint[i] = CleanseLogMessage.Cleanse(packet.Fingerprint[i]);
                }
            }

            if (packet.Extra != null)
            {
                var target = JObject.FromObject(packet.Extra);
                new CleansingJsonVisitor().Visit(target);
                packet.Extra = target;
            }
        }
Exemple #2
0
        public JsonPacket Create(string project, SentryEvent @event)
        {
            var packet = new SonarrSentryPacket(project, @event);

            try
            {
                foreach (var exception in packet.Exceptions)
                {
                    foreach (var frame in exception.Stacktrace.Frames)
                    {
                        frame.Filename = ShortenPath(frame.Filename);
                    }
                }
            }
            catch (Exception)
            {
            }

            return(packet);
        }