From e5d1aa8b0a7c35e8740d7908b13e13da8e6fff68 Mon Sep 17 00:00:00 2001 From: Kevin Mack Date: Fri, 28 Jun 2024 18:36:55 +0000 Subject: [PATCH] Testing with a catch --- src/MessageHandlers/_MessageHandler.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MessageHandlers/_MessageHandler.cs b/src/MessageHandlers/_MessageHandler.cs index 9552047..8af8741 100644 --- a/src/MessageHandlers/_MessageHandler.cs +++ b/src/MessageHandlers/_MessageHandler.cs @@ -19,7 +19,8 @@ public MessageHandler(ILogger> logger, Utils.PluginDelegates p } public void MessageReceived(T message, MessageFormats.Common.DirectToApp fullMessage) => Task.Run(() => { - using (var scope = _serviceProvider.CreateScope()) { + try { + using (var scope = _serviceProvider.CreateScope()) { if (message == null || EqualityComparer.Default.Equals(message, default)) { _logger.LogInformation("Received empty message '{messageType}' from '{appId}'. Discarding message.", typeof(T).Name, fullMessage.SourceAppId); @@ -30,7 +31,12 @@ public void MessageReceived(T message, MessageFormats.Common.DirectToApp fullMes case string messageType when messageType.Equals(typeof(MessageFormats.HostServices.Link.LinkRequest).Name, StringComparison.CurrentCultureIgnoreCase): LinkRequestHandler(message: message as MessageFormats.HostServices.Link.LinkRequest, fullMessage: fullMessage); break; + } } } + catch (Exception ex) { + var no_error = true; + } + }); }