[progress Communities] [progress Openedge Abl] Forum Post: Re: More Error-handling 101

  • Thread starter Thread starter Mike Fechner
  • Start date Start date
Status
Not open for further replies.
M

Mike Fechner

Guest
I like that point of view from Laura! And I am glad, that Gilles' SonarSource has a rule for that condition Sent from Nine Von: Laura Stern Gesendet: 03.05.2017 11:41 nachm. An: TU.OE.Development@community.progress.com Betreff: RE: [Technical Users - OE Development] More Error-Handling 101 Update from Progress Community Laura Stern For the reason I said - the FINALLY block is meant to do clean-up code and the like. It is not meant to override the behavior of the main block. The really obnoxious case is when there is no error condition and the main code does RETURN 10 and the FINALLY block does RETURN 20. We allow that! What the heck does that mean? The ABL will return 20 (the last statement wins). Another case, which is a variation of the one in this post is that there is an untrapped error in the main block (i.e., it is not caught). And then the FINALLY statement does RETURN 10. Well, if you wanted to ignore the error, why didn't you catch it or use NO-ERROR? Just returning a good value from the FINALLY when an error happened that you didn't handle is a very bad coding practice. In C#, for example, they do not allow return statements in finally blocks to avoid all of this confusion. View online You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here . Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Back
Top