Trapping Save() Errors


Author
Message
choyt
choyt
StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)StrataFrame Novice (92 reputation)
Group: Forum Members
Posts: 78, Visits: 246
Hi Folks

I am currently doing something similar to the following on every save() I do.

Select Case Me.Save

Case MicroFour.StrataFrame.Data.SaveUndoResult.AbortedWithBrokenRules

Throw New BrokenRulesException(Me.BrokenRules)

Case MicroFour.StrataFrame.Data.SaveUndoResult.FailedWithExceptions

Throw New ApplicationException("The save failed.")

End Select

I trap for broken rules and bubble them up with one custom exception class, and throw exceptions for the other results. Because of this I wind up with an ugly Case statement for every save. Is there any reason not to move this logic to the ErrorSaving event of the business object's themselves to centralize this or is this just the best way to do it?

Thanks!

Clay


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search