public override async Task <SentryResponse> SendEventAsync(
            SentryEventData eventData)
        {
            if (!IsEnabled)
            {
                return(SentryResponse.Empty());
            }

            using (var stream = _serializer.Serialize(eventData))
                using (var res = await SendMessageAsync(stream))
                {
                    var responseProvider = new SentryResponseProvider(_serializer);

                    return(await responseProvider.GetResponseAsync(res));
                }
        }
Ejemplo n.º 2
0
 public static Task AfterSendAsync(SentryResponse response, HttpContext http)
 => Task.Run(() => http.Items["SentryEventId"] = response?.EventId);
 private bool IsTooManyRequests(SentryResponse response)
 => response.StatusCode == 429 &&
 response.RetryAfter != null;