Feature #12012
raise 4GL warnings as warnings, so SUPPRESS-WARNINGS applies to them
0%
History
#1 Updated by Greg Shah 19 days ago
Raise 4GL warnings as warnings, so SUPPRESS-WARNINGS applies to them¶
Project: Base Language
Related: #5901 (some 4GL warnings must process differently when the current scope has a CATCH block)
Problem¶
SESSION:SUPPRESS-WARNINGS and SUPPRESS-WARNINGS-LIST are implemented in ErrorManager (isSuppressWarnings, around lines 1453, 1484, 3442 and 3791). They suppress whatever FWD raises through the warning path (recordOrShowWarning and the warning mode of recordOrShowError).
The problem is classification. Some conditions that the 4GL raises as a warning are raised by FWD as an error, through recordOrThrowError, so the suppression never sees them. An application commonly sets SUPPRESS-WARNINGS = TRUE once at startup and leaves it on. Under FWD, each misclassified condition then appears to the user as an error message, or raises the ERROR condition and changes the flow of control, where OpenEdge stays silent and continues.
There is also a defect in setSuppressWarningsList (near ErrorManager.java:3823). A successful assignment adds the new numbers to the existing set without clearing it first, so a second assignment does not replace the first. Only an invalid entry clears the set.
Work¶
- Build an inventory of the messages FWD raises with
recordOrThrowErrorordisplayError. For each, establish from OpenEdge whether the 4GL issues it as an error or as a warning. Its documentation,PROMSGSand testcases are the sources. There are roughly 500recordOrThrowErrorcalls inutilalone, so start with the conditions most likely to occur in ordinary programs:- numeric overflow and display format (for example the "value does not fit" family);
- string length;
-mmax/-stype resource warnings;- conversions and widget attribute assignments.
- Route each warning-class condition through the warning path, so that:
SUPPRESS-WARNINGSsuppresses its display;SUPPRESS-WARNINGS-LISTsuppresses it by number;- it does not raise
ERRORand does not setERROR-STATUS:ERROR, but is recorded inERROR-STATUSthe way the 4GL records it, including underNO-ERROR.
- Make
SUPPRESS-WARNINGS-LISTreplace the previous list on assignment. - Check that suppression is honoured wherever the message is displayed, on the server and on the client.
- Coordinate with #5901, which covers how warnings behave inside a scope with a
CATCHblock.
Testcases¶
For each reclassified message, a testcase run against OpenEdge for the baseline that covers:- the message with
SUPPRESS-WARNINGSoff and on; - the message with its number in, and not in,
SUPPRESS-WARNINGS-LIST; - the message with and without
NO-ERROR, checkingERROR-STATUS:ERROR,NUM-MESSAGESandGET-NUMBER; - that flow of control continues after the warning.
Also add a testcase for replacing SUPPRESS-WARNINGS-LIST.