diff --git a/backend/SyncReverseProxy/ProxyKernel.cs b/backend/SyncReverseProxy/ProxyKernel.cs index 39c2cf256..6f85563cf 100644 --- a/backend/SyncReverseProxy/ProxyKernel.cs +++ b/backend/SyncReverseProxy/ProxyKernel.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using OpenTelemetry.Trace; using Yarp.ReverseProxy.Forwarder; namespace LexSyncReverseProxy; @@ -108,14 +109,22 @@ private static async Task Forward(HttpContext context, } await forwarder.SendAsync(context, requestInfo.DestinationPrefix, httpClient); - switch (hgType) + try { - case HgType.hgWeb: - await eventsService.OnHgRequest(context); - break; - case HgType.resumable: - await eventsService.OnResumableRequest(context); - break; + switch (hgType) + { + case HgType.hgWeb: + await eventsService.OnHgRequest(context); + break; + case HgType.resumable: + await eventsService.OnResumableRequest(context); + break; + } + } + catch (Exception e) + { + Activity.Current?.RecordException(e); + //we don't want to throw errors from the post process event } }