From 6b5090441ba36cfbf9307feba0f179f910a5b3a0 Mon Sep 17 00:00:00 2001 From: "Matthew D. Groves" Date: Mon, 25 Sep 2023 11:09:23 -0400 Subject: [PATCH] #20 trying again --- Conduit/Conduit.Tests/TestHelpers/JsonTestHelpers.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Conduit/Conduit.Tests/TestHelpers/JsonTestHelpers.cs b/Conduit/Conduit.Tests/TestHelpers/JsonTestHelpers.cs index 6878468c68..a46fc7d099 100644 --- a/Conduit/Conduit.Tests/TestHelpers/JsonTestHelpers.cs +++ b/Conduit/Conduit.Tests/TestHelpers/JsonTestHelpers.cs @@ -16,14 +16,9 @@ public static T SubDoc(this string @this, string subDocKey) throw new ArgumentException($"SubDoc '{subDocKey}' not found in JSON."); return obj[subDocKey].ToObject(); } - catch - { - Trace.WriteLine("TRACE There was a problem getting the subdoc of '{subDocKey}' from this JSON string: '{@this}"); - Debug.Print($"DEBUG There was a problem getting the subdoc of '{subDocKey}' from this JSON string: '{@this}"); - var logfactory = (ILoggerFactory)new LoggerFactory(); - var logger = new Logger(logfactory); - logger.LogError($"TRACE There was a problem getting the subdoc of '{subDocKey}' from this JSON string: '{@this}"); - throw; + catch (Exception ex) + { + throw new ArgumentException($"TRACE There was a problem getting the subdoc of '{subDocKey}' from this JSON string: '{@this}", ex); } } }