MarimerLLC / cslaforum

Discussion forum for CSLA .NET
https://cslanet.com
Other
31 stars 6 forks source link

Example of Exceptions in DataPortal_XYZ #130

Open Reosoft1 opened 8 years ago

Reosoft1 commented 8 years ago

Hi

Is there any example code that demonstrates how to allow exceptions to occur in an Encapsulated Invoke model? When an database exception occurs in my DataPortal_XYZ code, the code stops. According to page 46 of the Data Portal book, it says that the exception is returned back to the client. What do I need to do to allow the exception to occur and return it back to the client. At what point does the client need to check for exceptions? A clear and descriptive example would be helpful.

ajj7060 commented 8 years ago

That should happen automatically, but be aware that the factory method will throw a DataPortalException, and your exception will be in its BusinessException property.