﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WebForms (How do I?)  » Trapping Save() Errors</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 02:51:48 GMT</lastBuildDate><ttl>20</ttl><item><title>Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11559.aspx</link><description>Hi Folks&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am currently doing something similar to the following on every save() I do.&lt;/P&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Select&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.Save&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult.AbortedWithBrokenRules&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Throw&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; BrokenRulesException(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BrokenRules)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult.FailedWithExceptions&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Throw&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; ApplicationException(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"The&amp;nbsp;save failed."&lt;/FONT&gt;&lt;FONT size=2&gt;)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Select&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;P&gt;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&amp;nbsp;ugly&amp;nbsp;Case statement for every save.&amp;nbsp;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?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Clay&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 19 Sep 2007 13:54:55 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11601.aspx</link><description>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.</description><pubDate>Wed, 19 Sep 2007 13:54:55 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11599.aspx</link><description>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.&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Public&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; Save(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; IsTransactional &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; MicroFour.StrataFrame.Data.SaveUndoResult&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Try&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; r &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MyBase&lt;/FONT&gt;&lt;FONT size=2&gt;.Save(IsTransactional)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; r = MicroFour.StrataFrame.Data.SaveUndoResult.AbortedWithBrokenRules &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Call&lt;/FONT&gt;&lt;FONT size=2&gt; Utility.SystemUtilities.ErrHandler.BrokenRulesHandler(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BrokenRules)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ElseIf&lt;/FONT&gt;&lt;FONT size=2&gt; r = MicroFour.StrataFrame.Data.SaveUndoResult.FailedWithExceptions &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Call&lt;/FONT&gt;&lt;FONT size=2&gt; Utility.SystemUtilities.ErrHandler.SaveFailedHandler(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.TableName)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Else&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; r&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Catch&lt;/FONT&gt;&lt;FONT size=2&gt; ex &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; Exception&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Call&lt;/FONT&gt;&lt;FONT size=2&gt; Utility.SystemUtilities.ErrHandler.SaveFailedHandler(ex)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Try&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P dir=ltr&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;P&gt;[/codesnippet]&lt;P&gt;The 2 Handler functions basically write to the event log and then rethrow a custom exception to the presentation layer.</description><pubDate>Wed, 19 Sep 2007 13:42:00 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11598.aspx</link><description>Cool...thanks Ben</description><pubDate>Wed, 19 Sep 2007 13:20:08 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11597.aspx</link><description>[quote]I'm not tracking on this part...[/quote]&lt;P&gt;I was just saying that when you create a new business object from our template, it will inherit from BusinessLayer, so you will need to change it so that it inherits from your class, not BusinessLayer.&amp;nbsp; The base class that you create will be excactly like you mentioned... it's a basic business object (that itself will inherit from BusinessLayer).</description><pubDate>Wed, 19 Sep 2007 13:08:44 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11596.aspx</link><description>Well, actually, the business object isn't going to ever return FailedWithExceptions from save()... :ermm:&lt;/P&gt;&lt;P&gt;If an exception is encountered from within the save, then the exception will just be bubbled up if the ErrorSavingMode is FailOnError and the return value will be CompletedWithExceptions if the ErrorSavingMode is ContinueOnError.&amp;nbsp; If ContinueOnError is used, then yes, the ErrorSaving event will contain the exceptions thrown.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So, the FailedWithExceptions is used for the SaveByForm() method, not the Save() method.&amp;nbsp; So, if you're going to be saving all of the business objects at once through the form's Save() method, then I you would want to override the SaveByForm() method and do the same thing (but I don't think that one is overridable, so if you're saving through the form's Save() method, then we might need to work out something different).</description><pubDate>Wed, 19 Sep 2007 13:06:28 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11595.aspx</link><description>Hi Ben&lt;P&gt;I'm not tracking on this part...&lt;/P&gt;&lt;P&gt;[quote]Just make sure to change the Inherits line (or the : line) when you create a new business object from our template.&lt;FONT size=1&gt;&lt;BR&gt;&lt;/FONT&gt;[/quote]&lt;P&gt;I generally create my own base classes using your templates then inherit from those.</description><pubDate>Wed, 19 Sep 2007 13:00:41 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11593.aspx</link><description>Thanks Ben&lt;/P&gt;&lt;P&gt;Is the ErrorSaving event the only place I can examine the exceptions that cause &lt;FONT size=2&gt;FailedWithExceptions?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Wed, 19 Sep 2007 12:55:21 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11588.aspx</link><description>Yep, looks good to me.&amp;nbsp; Centralizes everything nice and neat.&amp;nbsp; Just make sure to change the Inherits line (or the : line) when you create a new business object from our template.</description><pubDate>Wed, 19 Sep 2007 12:49:34 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11581.aspx</link><description>Hi Ben&lt;P&gt;This is what I've come up with...what do you think?&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT size=2&gt; Save(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;FONT size=2&gt; b &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Boolean&lt;/FONT&gt;&lt;FONT size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; r &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult&lt;/P&gt;&lt;P&gt;r = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MyBase&lt;/FONT&gt;&lt;FONT size=2&gt;.Save(b)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Not&lt;/FONT&gt;&lt;FONT size=2&gt; (r = MicroFour.StrataFrame.Data.SaveUndoResult.Success &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OrElse&lt;/FONT&gt;&lt;FONT size=2&gt; _&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;r = MicroFour.StrataFrame.Data.SaveUndoResult.Cancelled &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OrElse&lt;/FONT&gt;&lt;FONT size=2&gt; _&lt;/P&gt;&lt;P&gt;r = MicroFour.StrataFrame.Data.SaveUndoResult.CompletedWithExceptions) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Select&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; r&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult.AbortedWithBrokenRules&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;FONT size=2&gt; strJson &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;String&lt;/FONT&gt;&lt;FONT size=2&gt; = LitJson.JsonHelper.WriteJsonString(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.BrokenRules)&lt;/P&gt;&lt;P&gt;Utility.SystemUtilities.ErrHandler.WriteEventLog(strJson, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;""&lt;/FONT&gt;&lt;FONT size=2&gt;, Diagnostics.EventLogEntryType.Error)&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Throw&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; Exceptions.BrokenRulesException(strJson)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Case&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Data.SaveUndoResult.FailedWithExceptions&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Throw&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; ApplicationException()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Select&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;</description><pubDate>Wed, 19 Sep 2007 10:23:17 GMT</pubDate><dc:creator>choyt</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11575.aspx</link><description>Well, the ErrorSaving event only catches exceptions that are caused during the save, and only if the ErrorSavingMode is set to ContinueOnError.&amp;nbsp; Your best bet would be to create a BoBase class and override the OnBusinessRulesChecked method.&amp;nbsp; If the business rules are broken, then throw your exception containing the business rules.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Another option would be to create the BoBase class and override Save().&amp;nbsp; Call MyBase.Save() and check the return value within your own Save() and check the select case there.&amp;nbsp; You could even show your form with the broken rules there if you don't mind taking that portion of the UI out of the UI...</description><pubDate>Wed, 19 Sep 2007 09:07:48 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Trapping Save() Errors</title><link>http://forum.strataframe.net/FindPost11562.aspx</link><description>Hi All&lt;/P&gt;&lt;P&gt;I wanted to add a little more detail to what I am trying to accomplish.&lt;/P&gt;&lt;P&gt;When performing Save(True) operations on multiple business objects at one time&amp;nbsp;and one of the&amp;nbsp;Save operations&amp;nbsp;fail, I want to rollback the transaction then throw a specific exceptin as described below.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When a save&amp;nbsp;fails due to&amp;nbsp;broken rules, I want to throw a custom&amp;nbsp;exception containing these broken rules to the presentation layer (we are currently converting the broken rules collection to a JSON string and passing that string).&lt;/LI&gt;&lt;LI&gt;When a save failes due to any other reason, I want to rethrow that exception up the chain&lt;/LI&gt;&lt;LI&gt;When either of the above happen, I want to write either the exception or the broken rules to the application log. The idea is that our presentation tier validation should nearly eliminate broken rules from being written to the app log (I hope!).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I thought about overriding the Save() method and putting the logic there. I also thought about putting the logic in the Business Rules Checked event but I'm thinking that would miss straight out failures.&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#1f5080&gt;What I'm looking for is mostly an idea of what would be the best practice and maybe how others are doing this type of operation,. I hope this makes sense!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#1f5080&gt;Clay&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 18 Sep 2007 20:24:00 GMT</pubDate><dc:creator>choyt</dc:creator></item></channel></rss>