StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


««12

Trapping Save() ErrorsExpand / Collapse
Author
Message
Posted 09/19/2007 1:42:00 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame 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 r

End If

Catch ex As Exception

Call Utility.SystemUtilities.ErrHandler.SaveFailedHandler(ex)

End Try

End Function

The 2 Handler functions basically write to the event log and then rethrow a custom exception to the presentation layer.

Post #11599
Posted 09/19/2007 1:54:55 PM


StrataFrame Developer

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
Post #11601
« Prev Topic | Next Topic »

««12

Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 4:52pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 12 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.