| | | 
StrataFrame Novice
       
Group: StrataFrame Users Last Login: 08/26/2008 10:34:32 AM Posts: 78, Visits: 242 |
| I really appreciate all your help. This is what I finally came up with. I'm going to put this on all of our base business objects.Public Overrides Function Save(ByVal IsTransactional As Boolean) As MicroFour.StrataFrame.Data.SaveUndoResult Try Dim r As MicroFour.StrataFrame.Data.SaveUndoResult = MyBase.Save(IsTransactional)If r = MicroFour.StrataFrame.Data.SaveUndoResult.AbortedWithBrokenRules Then Call Utility.SystemUtilities.ErrHandler.BrokenRulesHandler(Me.BrokenRules)ElseIf r = MicroFour.StrataFrame.Data.SaveUndoResult.FailedWithExceptions Then Call Utility.SystemUtilities.ErrHandler.SaveFailedHandler(Me.TableName)Else Return rEnd IfCatch ex As Exception Call Utility.SystemUtilities.ErrHandler.SaveFailedHandler(ex)End TryEnd Function The 2 Handler functions basically write to the event log and then rethrow a custom exception to the presentation layer. |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: 2 days ago @ 5:02:56 PM Posts: 2,682, Visits: 1,882 |
| Looks good, just make sure that when you throw the exception from within the handlers, that you include the supplied exception as an inner exception in case you need to get back to the stack trace some how.
www.bungie.net |
| |
|
|