Project

General

Profile

Feature #6426

implement ERROR-STATUS:CLEAR()

Added by Greg Shah almost 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Theodoros Theodorou
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
version:

screenshot.png (5.61 KB) Theodoros Theodorou, 02/17/2023 12:51 PM

TestEncryptionIv.java Magnifier (1.17 KB) Theodoros Theodorou, 02/20/2023 08:35 AM

History

#1 Updated by Greg Shah almost 2 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 about 1 year ago

  • Assignee set to Theodoros Theodorou

#3 Updated by Theodoros Theodorou about 1 year 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 about 1 year ago

Greg, do you recall which OE version the customer's code was running?

#5 Updated by Greg Shah about 1 year 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 about 1 year 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 about 1 year 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 about 1 year ago

Do I need to do something more for this ticket now?

#9 Updated by Greg Shah about 1 year ago

I need to discuss this with the customer.

FWD fails during conversion of this testcase, right?

#10 Updated by Theodoros Theodorou about 1 year 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 about 1 year 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 about 1 year 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 about 1 year ago

I'm confused, how does FWD convert error-status:clear().?

#14 Updated by Theodoros Theodorou about 1 year ago

I am not sure. I compiled and ran the app using the testcases project without any issues.

#15 Updated by Constantin Asofiei about 1 year ago

Post here the .java file for your converted program.

#16 Updated by Theodoros Theodorou about 1 year ago

#17 Updated by Constantin Asofiei about 1 year ago

There is nothing emitted by conversion in error-status:clear()., see the standalone ; char on a single line.

#18 Updated by Theodoros Theodorou about 1 year ago

Yes, I noticed it. Do I need to make any changes (e.g. show a warning)?

#19 Updated by Constantin Asofiei about 1 year 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 about 1 year 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.

Also available in: Atom PDF