You can use following pattern

try {
    item.Update();
}
catch(SPListDataValidationException ex) {
    //ex.Message
}


https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistdatavalidationexception_members(v=office.14).aspx

c# - how to validate sharepoint list column against ValidationFormula programmatically
I don't like scripts that use: 

// @include http://*


they overload many pages, where we didn't want to, also because I had problems in past, while writing a script, console was full of errors produced by scripts of this kind. I recognize scripts like these ones anti-adblock , noPicAds are on my required list, but in order to use them I change the includes to the specific page I use. Let's suppose, I entered on a webpage and it says: "You need to disable Adblock" so I grab the url, go manually and edit the anti-adblock script adding 

// @include http://example.com/*


refresh the page and it's working.
Now when the scripts update, everything is lost. No I don't want to stop updating, because I think these kind of scripts are essentially needed to stay updated. 

My question is, there's anyway to keep include changes after update?
