Skip to content

Rule request - Blocks that are not affected by BLOCK-LEVEL ON ERROR UNDO, THROW need error handling #1073

Open
@movedoa

Description

There are blocks that are not effected by BLOCK-LEVEL ON ERROR UNDO, THROW.
https://docs.progress.com/bundle/openedge-abl-error-handling-122/page/BLOCK-LEVEL-ON-ERROR-UNDO-THROW-statement.html

A rule that checks if every DO and DO WHILE block has an error handling directive and every Destructor and Event Method (every method that is subscribed to something) has a catch would help to deal with unexpected errors in the code.

The ABL Events are a bit of a special case since if the Publish comes from the AVM, the error is thrown to the publish, which is fine.
But if you subscribe to anything in the .NET runtime (a winforms control for example), the error is still raised in the normal way, the only way to handle that is a catch in the subscribed method.
https://docs.progress.com/bundle/openedge-oo-abl-develop-applications/page/Raise-errors-within-a-class-event-handler.html

A classic example of this problem is a session that runs in batch mode and has some error in, lets say, the destructor.
Without a catch ther error message is piped to stdout (maybe a terminal window, maybe a log file) but all you get ist "Lead attributes in a chained-attribute expression" without a stack or any additional infos.

This is especially fun with bugs that only appear once a month under unknown conditions.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions