[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: May OpenEdge classes set the error-status?

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

Mike Fechner

Guest
An API should be a black box and should not leave an error state behind when there is no error tob e handled by the caller. Either do CAN-FIND or ERROR-STATUS:ERROR = FALSE NO-ERROR . We do that most of the time The SonarCube rule that reports all NO-ERROR’s as a bad habit really helps. In case of that FIND ELSE CREATE we’d do FIND record WHERE record.keyvalue = …. NO-ERROR /* it’s a temp-table, so no locking */. IF NOT AVAILALBE record THEN DO: Consultingwerk.Util.ErrorHelper:ResetErrorStatus (). /* does ERROR-STATUS:ERROR = FALSE NO-ERROR */ CREATE record. ASSIGN record.keyvalue = … END.

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