Пример #1
0
        /// <summary>
        /// Asynchronously transmits an exception to Raygun.
        /// </summary>
        /// <param name="exception">The exception to deliver.</param>
        /// <param name="tags">A list of strings associated with the message.</param>
        /// <param name="userCustomData">A key-value collection of custom data that will be added to the payload.</param>
        public async Task SendInBackground(Exception exception, IList <string> tags, IDictionary userCustomData)
        {
            if (CanSend(exception))
            {
                // We need to process the Request on the current thread,
                // otherwise it will be disposed while we are using it on the other thread.
                RaygunRequestMessage currentRequestMessage = await BuildRequestMessage();

                RaygunResponseMessage currentResponseMessage = BuildResponseMessage();

                var task = Task.Run(async() =>
                {
                    _currentRequestMessage.Value  = currentRequestMessage;
                    _currentResponseMessage.Value = currentResponseMessage;
                    await StripAndSend(exception, tags, userCustomData);
                });
                FlagAsSent(exception);
                await task;
            }
        }
Пример #2
0
 public IRaygunMessageBuilder SetResponseDetails(RaygunResponseMessage message)
 {
     _raygunMessage.Details.Response = message;
     return(this);
 }