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)); } }
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;