<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

Newtonsoft.Json.Serialization.OnErrorAttribute

public sealed class OnErrorAttribute : Attribute
When applied to a method, specifies that the method is called when an error occurs serializing an object.
namespace Newtonsoft.Json.Serialization { public sealed class OnErrorAttribute : Attribute { public OnErrorAttribute(); } }