How to Validate with Catch but Report as Warning
Posted: Tue Jul 17, 2012 3:02 pm
Hi All,
I'm currently evaluating the software and trying to find a solution for a problem I have encountered. I have had a quick look at the API doc but was unable to find an answer (I'm not a developer so don't know the code well).
With code below I check to see if an object is already created - if the validation fails I then create the object and continue.
I just want to give a warning if the validation fails rather than the error it gives now.
Chris
I'm currently evaluating the software and trying to find a solution for a problem I have encountered. I have had a quick look at the API doc but was unable to find an answer (I'm not a developer so don't know the code well).
With code below I check to see if an object is already created - if the validation fails I then create the object and continue.
I just want to give a warning if the validation fails rather than the error it gives now.
public void Setup_ODBC() { try { Validate.Attribute(repo.SelectDataSource.CellXlsInfo, "Text", "xls"); //Question: How to give warning if this fails with it still running the catch Report.Log(ReportLevel.Success, "XLS already exists"); } catch { Report.Log(ReportLevel.Info, "CREATING XLS OBJECT"); //CREATION CODE HERE Report.Log(ReportLevel.Info, "XLS now created"); } }Thanks for your time,
Chris