StrataFrame Forum

Handling Business Object ArgumentExceptions

http://forum.strataframe.net/Topic21840.aspx

By Rylster - 2/5/2009

Hi there,

When the expected field is not returned by a stored procedure the BO raises the ArgumentException error when debugging the code. However, there is no error message when running in the release mode.

I can place try{} catch(System.Argument Exception) {} code in each property of the BO.Designer.cs file that records the error to a log file or displays a message but this will be overwritten the next time the BO is built in the business object mapper.

What is the best way to handle these ArgumentException errors? I need to know if these errors are happening in a release version when the program is being used by the customer.

By Greg McGuffey - 2/5/2009

Not entirely sure what is causing the error from your description. I'd first try to understand what is causing the error. If after that you determine that a try/catch is the way to go, you could use the custom code feature to manually add this in a way that would get reproduced when using the BO mapper. However, you'll have to code the entire property for each field that needs this. If you could provide some more details (like a call stack) about that is happening, maybe we can determine why you are getting the error.