In my business objects, I have a error collection class. It has a method to
pretty print the collection in html format.
I can then perform my business operation and catch all of the exceptions
without rethrowing them. Then, if my error collection has a size > 1 I know
there was an error and I print them to the page.
Or, just always put a try catch around business transactions and never put
them in your business/data layer.
There are always arguments either way..... to ignore errors in the
business/data layer and just continue processing or.... warn/throw an error
to the calling procedure when you encounter something bad!
--
Direct Email:
Michael.Baltic@RemoveCharactersUpTo#NCMC.Com
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Big Dave" wrote:
Does anyone have suggestions on how to best handle errors in business
objects that are part of a business layer? For example:
Public Class Person
Private _name as string
Public Property Name as string
Get
Return _name
End Get
Set(Value as string)
If Value.toString.length > 50 then
'How do I send a friendly error message back to the
presentation layer saying the value isn't correct? I know I can
validate it on the form, but I'd like to also validate in the business
objects.
Else
_name = Value
End If
End Set
End Property
End Class
Thanks in advance for any help!!!
Big Dave
*** Sent via Developersdex http://www.developersdex.com ***