CSLA 3.8 Question - is it possible to log Data Portal Exceptions on the server side?

CSLA 3.8 Question - is it possible to log Data Portal Exceptions on the server side?

Old forum URL: forums.lhotka.net/forums/t/12815.aspx


SethSpearman posted on Thursday, January 15, 2015

I know that this capability has been added to CSLA 4.x with the inclusion of the IDataPortalExceptionInspector.  We have an old "legacy" project using CSLA 3.0.x (but which I just verified today could be upgraded to 3.8 in a couple of hours if need be).

We would like to add server-side data portal exception logging (since the server is in our dmz which has access to our database where we can log it. )

Can this be done in 3.8x?  I was hoping that it would raise some kind of exception event that we could subscribe too but I don't see anything.

It is NOT a have-to-do item but would be nice.  Any ideas?

Seth

 

JonnyBee replied on Saturday, January 17, 2015

Hi, 

The only way to do this is to implement DataPortal_OnDataPortalException method in your "root" objects (read: Object that your code call DataPortal.Create/Fetch/Execute/Update/Delete root methods on). You may also choose to implement these in your own intermediate base classes.

This will give you access to the exception that occurred but you cannot change the exception.

Not sure when this method was implemented. it is not in CSLA 3.0.5 but is in CSLA 3.8.x.

 

Copyright (c) Marimer LLC