Hi,
I have created an InfoPath 2007 form which makes use of some custom code I have written. I now want to implement some error handling and logging for my form. Some things about my form:
It is browser enabled and will be accessed from a SharePoint site. If the user accessing the form has InfoPath installed the form will open in InfoPath. If they don't have InfoPath the form will open in the browser.
The form is managed and deployed through InfoPath Form services in SharePoint central admin. This is so that it makes use of universal data connections I have created to access various SharePoint lists and a web service to populate some fields on my form.
I would like to be able to display a user friendly message to a user if an error is caught in any of the code behind the form. I have made use of try {} catch {} blocks. I know how to display a nice generic error message on the form to the user, i'm now wondering how best to go about logging the stack trace elsewhere for development support purposes. I don't want to display this information to the user on the form. I am thinking of trying to write to the event log on a specific machine but am wondering if this would even be possible if the form is opened in InfoPath application on a users own machine (i.e. they probably won't have access to the machine I want to write to the event log on).
Has anyone done something similar previously? If so can you please let me know / give me some ideas on how I could go about logging the stack trace for dev purposes but displaying a nice user friendly error message to the user on the form.
Thanks