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));
                }
        }
Exemple #2
0
        private async Task <SentryResponse> SendEventAsync(SentryEventData eventData)
        {
            if (_rateLimit.IsHit(UtcNow))
            {
                return(null);
            }

            var response = await _sentryClient
                           .SendEventAsync(eventData);

            if (IsTooManyRequests(response))
            {
                _rateLimit.Until(response.RetryAfter);
            }

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

            using (var stream = _streamSerializer.Serialize(eventData))
            {
                var httpResponse = await _sender
                                   .SendAsync(ComposeMessage(stream), None)
                                   .ConfigureAwait(false);

                var responseProvider = new SentryResponseProvider(_streamSerializer);

                return(await responseProvider.GetResponseAsync(httpResponse));
            }
        }