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 public OnErrorAttribute()