OnErrorAttribute public sealed class OnErrorAttribute : Attribute When applied to a method, specifies that the method is called when an error occurs serializing an object. Documentation Code using System; namespace Newtonsoft.Json.Serialization { [AttributeUsage(AttributeTargets.Method, Inherited = false)] public sealed class OnErrorAttribute : Attribute { } }