Checking which exception occurred from AfterSave


Author
Message
Bruce Palmer
Bruce Palmer
StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)
Group: Forum Members
Posts: 18, Visits: 33
Hi guys,



I'm trying to gracefully handle an SqlException, "Violation of UNIQUE KEY constraint...".



To stop the exception being thrown and showing the default error message, I'm setting the business objects ErrorSavingMode property to ConitnueOnError. In the forms AfterSave event I can see e.SaveUndoResult, which is set to CompletedWithExceptions.



So, in the forms AfterSave event I know that an exception occurred, but I'm not sure how to check which exception. I want to check this to make sure it really is a "Violation of UNIQUE KEY constraint..." exception and not something else.



Any suggestions?



Regards,

Bruce

Replies
Bruce Palmer
Bruce Palmer
StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)StrataFrame Beginner (20 reputation)
Group: Forum Members
Posts: 18, Visits: 33
Hi Ben,



Thanks for your reply. In a way I'm relieved. For a while there I thought I might be going crazy!w00t



I spent several hours stepping through my code and yours trying to figure out what was going on with the ErrorSaving event. I couldn't find any place where it was raised. I hesitated to mention it though, as I simply can't know the StrataFrame code base as well as you guys, and figured I had to be overlooking something. Apparently not.



I notice you haven't said anything about the data corrupting behaviour. To my mind, the fact that it was so easy to create this behaviour just by innocently changing a single property is a major issue. Not raising events as advertised is one thing. Corrupting the database is in a class of it's own. Even if what I did was wrong (and I was only following a suggestion by Trent) it shouldn't result in corrupt data. The framework should protect the database at all costs. Fixing this should take precedence over any new features.



So, how long before you guys get the 1.5 release out the door? (You've all got your caffeine drips attached, right?BigGrin)



Regards,

Bruce

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
So, how long before you guys get the 1.5 release out the door? (You've all got your caffeine drips attached, right?)

Well, it has been a very long week with several late nights already.  Today will probably be the longest and will result in the 1.5 being posted before we go home....even if that is midnight Smile

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