Feature #6426
implement ERROR-STATUS:CLEAR()
100%
History
#1 Updated by Greg Shah about 4 years ago
ERROR-STATUS:CLEAR() was found in customer code. It is undocumented. We need to figure out its behavior and implement it.
#2 Updated by Greg Shah over 3 years ago
- Assignee set to Theodoros Theodorou
#3 Updated by Theodoros Theodorou over 3 years ago
- Status changed from New to WIP
I read a bit about the error-status but I couldn't find anything online regarding error-status:clear(). I tried to write a small program to see the behaviour of this but I get a warning saying **Clear is not a queryable attribute for PSEUDO-WIDGET. (4052)
security-policy:symmetric-encryption-algorithm = 'test' no-error. message error-status:error. message error-status:num-messages. error-status:clear(). message error-status:error. message error-status:num-messages.
Is this a valid command?
#4 Updated by Constantin Asofiei over 3 years ago
Greg, do you recall which OE version the customer's code was running?
#5 Updated by Greg Shah over 3 years ago
I think it is 11.7.
Perhaps this is just broken code (at runtime) but it compiles. Or perhaps it is a newer (undocumented) feature.
#6 Updated by Constantin Asofiei over 3 years ago
In OE 11.6.3 this attribute is not part of the ERROR-STATUS handle.
OE does not do any compile-time strong-type checks for any kind of handle (even for system handles like ERROR-STATUS). IMO, this should be fixed in the 4GL code for the customer's app; otherwise, if we start to pollute all FWD system handles (like ErrorManager class) with methods just to throw is not a queryable attribute for PSEUDO-WIDGET., this can get ugly.
#7 Updated by Greg Shah over 3 years ago
True, though we will eventually be implementing a pure handle approach to everything. For example, I expect an ERROR-STATUS reference to convert to something like ErrorManager.getErrorStatus() which would return a handle. The result will be a simpler conversion, where right now we convert the use of system handles differently. It is messy, inconsistent and incomplete in our methods_attributes.rules as a result.
As you say, for now it would be harder to add this error handling in our current approach. In the future approach, I we get it "for free" with the limit that we no longer have direct references to the system resources.
#8 Updated by Theodoros Theodorou over 3 years ago
Do I need to do something more for this ticket now?
#9 Updated by Greg Shah over 3 years ago
I need to discuss this with the customer.
FWD fails during conversion of this testcase, right?
#10 Updated by Theodoros Theodorou over 3 years ago
No, FWD does not fail during conversion. FWD and OE both have the same output. The only difference is that OE pops up a warning window and FWD does not.
#11 Updated by Greg Shah over 3 years ago
Hmm, we must have done something special for this case (or for ERROR-STATUS in general).
To confirm, the error in FWD happens at runtime. Correct?
#12 Updated by Theodoros Theodorou over 3 years ago
Yes, the error occurs at runtime
security-policy:symmetric-encryption-algorithm = 'test' no-error. // This creates 2 runtime errors. message error-status:error. // This prints 'yes' message error-status:num-messages. // This prints '2' error-status:clear(). // In FWD this line does nothing. In OE it pops up a warning window. When you close the warning, the program continues. message error-status:error. // This prints 'yes' message error-status:num-messages. // This prints '2'
#13 Updated by Constantin Asofiei over 3 years ago
I'm confused, how does FWD convert error-status:clear().?
#14 Updated by Theodoros Theodorou over 3 years ago
- File screenshot.png added
I am not sure. I compiled and ran the app using the testcases project without any issues.
#15 Updated by Constantin Asofiei over 3 years ago
Post here the .java file for your converted program.
#16 Updated by Theodoros Theodorou over 3 years ago
- File TestEncryptionIv.java
added
#17 Updated by Constantin Asofiei over 3 years ago
There is nothing emitted by conversion in error-status:clear()., see the standalone ; char on a single line.
#18 Updated by Theodoros Theodorou over 3 years ago
Yes, I noticed it. Do I need to make any changes (e.g. show a warning)?
#19 Updated by Constantin Asofiei over 3 years ago
Greg, IMO, I think we are OK with 'doing nothing'. Otherwise, we can treat these cases of invalid attribute/method reference in a system handle via i.e. ErrorManager.asHandle, and let this be the 'handle name'.
#20 Updated by Greg Shah over 3 years ago
- Status changed from WIP to Closed
- % Done changed from 0 to 100
In the short term it is fine. In the longer term we will probably need to fix it.