Closed angularsen closed 1 year ago
Looks good. Even though - it feels a bit strange as constants handled exceptions might reduce whole application performance and it will be very hard to notice.. But seems like we do not have a lot of options here.
To add some more context, these were the log sinks we used:
When logging events that include an exception that has a getter-property that throws an exception, it results in a JSON serialization exception that drops the entire log event instead of just the problematic property.
This was observed with Akka.NET when there was a problem with instantiating a new actor due to missing dependency injection configuration.
By handling JSON errors, we can omit the problematic property instead of dropping the entire log event. https://www.newtonsoft.com/json/help/html/serializationerrorhandling.htm
Changes
FormatPayload
into try-catch to handle any other exceptions during formattingTesting