Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: 6017 error  (Read 12701 times)
Candy M.
Posts: 139


« on: May 07, 2018, 06:26:08 pm »

Has the behavior slightly changed when 6017 error is thrown in 3.10?

I have a simple program:

Code
  1. MAIN
  2.        IF ui.Interface.getFrontEndName() != "Console" THEN
  3.                CLOSE WINDOW SCREEN
  4.        END IF
  5. END MAIN
  6.  
When I run it in the GDC, I get User limit exceeded in a popup window from the 4gl in addition to the popup window that the GDC shows which I believe
shows when it catches that phrase  (see attached image, I don't know how to embed images in the forum).

I'm thinking that prior to this release, the error only showed like a DISPLAY in the terminal window and the GDC caught it and it displays as a GDC error.   But now, it shows in the popup window which I don't believe I have control over.   So what happens, users report it as a bug, ignoring the message the GDC says.   
Is there something I'm missing here?   I'm suppose to fix it which I don't think I can.  We don't want the 4GL popup window (on the left of my attachment, we just want the window I circled).

Candy



* USER LIMIT.PNG (111.4 KB, 789x404 - viewed 986 times.)
Reuben B.
Four Js
Posts: 949


« Reply #1 on: May 08, 2018, 01:15:21 am »

Candy,

You probably need to be aware of this http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_Migrate_to_310_fatal_errors.html

This solves the old chestnut of how to display a message indicating that the license count has been exceeded, when a 4gl program to do that would in itself consume a license and so could not run.

I suspect you have in the past implemented a workaround for that by modifying the GDC Connection strings so that if the 4gl wrote the appropriate text to stdout/stderr, you had the GDC Connection String display your message.  If you revert your GDC Connection String back to the default then you should only get one dialog box.

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Reuben B.
Four Js
Posts: 949


« Reply #2 on: May 08, 2018, 01:17:04 am »

I should also add that as this has been done in the FGL, it will apply across all clients, GDC, GBC, GMI, GMA.  Your existing solution of manipulating the GDC connection strings would only work on GDC, not the other clients.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Candy M.
Posts: 139


« Reply #3 on: May 08, 2018, 01:50:45 am »

Thanks Reuben.   However, I have not touched the GDC connection strings.   I am using the GDC connecting strings that
are installed with the GDC client.   I'll install the latest GDC client tomorrow and see if it still occurs.

Is there a way to trap so I get a more graceful message?

Thanks,
Candy
Reuben B.
Four Js
Posts: 949


« Reply #4 on: May 08, 2018, 06:15:37 am »

Sorry Candy, there is an entry in the GDC Connection Strings.  Many years ago I recall adding it manually for my sites.  Doesn't detract from what I think is occurring.  That is one dialog comes from the GDC Connection String, one dialog comes from the  fatal runtime error message.

My understanding is that FGL_WINMESSAGE() is used to display the message.  As this is in FGLDIR/src/fgldialog.4gl FGLDIR/lib/fgldialog.42m then you could investigate the path of trapping the message and displaying something more to your satisfaction.

Reuben


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Reuben B.
Four Js
Posts: 949


« Reply #5 on: May 14, 2018, 11:59:51 pm »

There has been a task created https://4js.com/support/issue/?id=GDC-3936 to remove the "User Limit Exceeded" Terminal Strings entry in GDC Short-cuts in a future GDC release.  In the interim, if you want to avoid duplicate dialogs like Candy has highlighted that may occur with FGL3.10.11 or greater, you will need to remove the individual entry yourself.

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Candy M.
Posts: 139


« Reply #6 on: May 15, 2018, 12:26:28 am »

Hello Reuben,
      We would like the capability of being able to make the message in the popup message prettier, that is, don't show
the line # of the 4gl or the name of the program and just display "User Limit Exceeded".   We will be getting support calls (and have)
on that because they will see the .4gl program name and line number and the error code -6017.

Thanks,
Candy
Reuben B.
Four Js
Posts: 949


« Reply #7 on: May 15, 2018, 01:08:03 am »

 
Quote
We would like the capability of being able to make the message in the popup message prettier, that is, don't show
the line # of the 4gl or the name of the program and just display "User Limit Exceeded".   We will be getting support calls (and have)
on that because they will see the .4gl program name and line number and the error code -6017.

I gave you the clue earlier.

The error message is being displayed via FGL_WINMESSAGE.  In case you aren't aware the source for that and a number of other functions can be found in FGLDIR/src, and the compiled executables in FGLDIR/lib.

So if you find in FGLDIR/src, fgldialog.4gl, in there you will find a function fgl_winmessage.

If you add at the beginning of that function, some text like ...

Code
  1. IF message.getIndexOf("User limit exceeded",1) > 0 THEN
  2.     LET message = "User Limit Exceeded"
  3. END IF

Compile it, and move the compiled file into FGLDIR/lib/ then you will see that you now have a simpler message.

As a general rule, I would not recommend touching what is in FGLDIR/src and FGLDIR/lib.  What you should do is take advantage of FGLLDPATH, and copy what you want to modify from FGLDIR/src into your sources, and place the compiled object higher up the FGLLDPATH than FGLDIR/lib, so that when the runtime looks for fgldialog.42m, it finds your copy that is placed higher up the FGLLDPATH than the copy in FGLDIR/lib

Reuben






Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Candy M.
Posts: 139


« Reply #8 on: May 15, 2018, 03:00:21 am »

Thanks Reuben.  I had seen your solution and looked at the program before. I was requesting something more general that could be used in the language itself, that could be clearer instead of changing fgl_winmessage function.

Candy
Candy M.
Posts: 139


« Reply #9 on: May 15, 2018, 06:28:29 pm »

Reuben,
    I tested that and it did work.
    I have a further question.   We keep track of licenses for our software and we have license types depending on what part of our application
the user uses.
    When we reach the maximum # users for our application which may be the same count as the 4js users count, is there a way
for us to display to our user that he/she has reached the maximum user limit on our software instead of the 4js user limit?
    For instance, our customer could be configured for 10 Enterprise user licenses.   And the # users for the 4js license is also 10 users.
When we run our software application, I am able to check for the maximum # Enterprise users with 4gl code.   So I want to display a message that the limit
has been reached.   I can use DISPLAY to show that message, which I believe I could trap in the GDC.   I tried using fgl_winQuestion which fgl_winMessage uses
but it threw the 6017 error when I tried to use it.   Maybe I could put a check also in the fgl_winMessage for our application user count.   I guess if I try to use any of the fgldialog functions when max 4js users reached it will throw the 6017 error.
    Not sure if that made any sense, but just wondering.
Candy

Candy
Reuben B.
Four Js
Posts: 949


« Reply #10 on: May 16, 2018, 02:01:23 am »

Quote
Reuben,
    I tested that and it did work.
    I have a further question.   We keep track of licenses for our software and we have license types depending on what part of our application
the user uses.
    When we reach the maximum # users for our application which may be the same count as the 4js users count, is there a way
for us to display to our user that he/she has reached the maximum user limit on our software instead of the 4js user limit?
    For instance, our customer could be configured for 10 Enterprise user licenses.   And the # users for the 4js license is also 10 users.
When we run our software application, I am able to check for the maximum # Enterprise users with 4gl code.   So I want to display a message that the limit
has been reached.   I can use DISPLAY to show that message, which I believe I could trap in the GDC.   I tried using fgl_winQuestion which fgl_winMessage uses
but it threw the 6017 error when I tried to use it.   Maybe I could put a check also in the fgl_winMessage for our application user count.   I guess if I try to use any of the fgldialog functions when max 4js users reached it will throw the 6017 error.
    Not sure if that made any sense, but just wondering.
Candy

Quote
I guess if I try to use any of the fgldialog functions when max 4js users reached it will throw the 6017 error.
Correct.  The user licence check occurs on any user interface code.  That is why you have never been able to write something of the form ...

Code
  1. MAIN
  2.   IF NOT license_check() THEN
  3.       CALL FGL_WINMESSAGE(... no more licenses ....)
  4.       EXIT PROGRAM 1
  5.   END IF
  6.   ...

because that code in turn would consume a user license.

What FGL-4216 has implemented is that when a program exits with an error, it picks up that error message and displays it via fgl_winmessage, with something happening being the scenes so that a license is not consumed by this UI code.  So it is the 4gl program running, but it is not consuming a license to display this UI.  This approach works across all the front-ends.

The GDC Connection String approach does not consume a license because it is not the 4gl program that is displaying the dialog, it is the GDC executable displaying a dialog in response to the 4gl program writing "User limit exceeded" to stdout/stderr.  As this is only implemented in GDC, this approach doesn't help GBC, GMI, GMA users.

Reuben



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Rene S.
Four Js
Posts: 103


« Reply #11 on: May 17, 2018, 09:21:45 am »

Hello,

https://agile.strasbourg.4js.com/jira/browse/FGL-4879
FGL-4879: ui: client error notification: omit error-number, file, line in case of license errors

Since FGL-4216 "ui: Notify the client whenever fglrun stops with an error.": the runtime displays a message box in case of fatal errors. The message is the same message as printed to stderr.
This message is decorated with the error-number and the location in the code. On demand of customers: License errors should not be decorated. Only the plain message text must be displayed.

It's "fixed" fixed in 3.10.13

Yes, it makes sense to commit the default error decoration in case of license errors: those errors are not related to an programming issue.

Rene

PS: the implementation of the error notification will *not* be changed. The program might be in a fragile state when a fatal error happens. The program is a an exceptional state on license errors...
Rene S.
Four Js
Posts: 103


« Reply #12 on: May 17, 2018, 09:25:16 am »

old:
Yes, it makes sense to commit the default error decoration in case of license errors: those errors are not related to an programming issue.

new:
Yes, it makes sense to omit  the default error decoration in case of license errors: those errors are not related to an programming issue.

(sometime autocorrection is contra-productive)
Candy M.
Posts: 139


« Reply #13 on: May 17, 2018, 03:04:58 pm »

Thank you so much Rene.

Is it possible to add a method that is a sort of last chance/opportunity to display a gui message before the 6017 is trapped?
We want to inform users that they have exceeded the license type for our software (ie Enterprise, Shop Floor, etc).   After the message displays and the user presses ok the program immediately ends.    So if one of our customers has 10 Enterprise user license of our package and 10 user license of 4js, we can display our message that Enterprise limit exceeded and not the FourJs.   Then it is a little more clearer in our application code when we trap and display the message instead of placing code in fgldialog.4gl which is a more obscure place.

Thanks,
Candy
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines