Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
YAM on troubleshooting run-time errors
Message
From
29/04/2021 15:18:17
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01680060
Message ID:
01680065
Views:
30
>Hi,
>
>After examining the run-time error log (mainly for one customer), I see one case where the error was created in an INIT method of some main form (I see Stack Level 5 indicating this error my_form.init). Then the error (Stack Level 6) goes to the function dl_ErrorMessage (a function in one of my prg). The function dl_ErrorMessage() has the code:
>
>oErrorForm = NEWOBJECT( "dl_error_message", "dl_error.vcx",'', tcTxtMessage, 
>tcTxtCaption, cParameter1, cParameter2, cParameter3 )
>oErrorForm.show()
>
>
>And here the actual error happens:
>
>Error reading file FQDN UNC Style\appfolder\libs\dl_error.vcx
>
>
>Oddly enough the error log is written to the APPFOLDER. So, the desktop is not completely disconnected from the Share.
>
>So, basically, if I understand correctly the application cannot file dl_error.vcx, which is INSIDE the EXE program.
>
>Two questions:
>1. How can I trap the error (or find out what exactly caused the error in the INIT method)? Should the entire INIT method to be within TRY/CATCH? Note, that even if I do that, the INIT initializes a bunch of BIZ objects that are dropped on the form. So, I am not sure where the error is generated, in the INIT code or in the code that instantiate all BIZ objects.
>2. Could the error 1 (above) be a precursor that the desktop lost connection to the network? And hence even the dl_error.vcx cannot be found?
>
>TIA
>
>UPDATE: Probably main question. What code should check if the Application EXE is still available and that the library DL_ERROR.VCX in this EXE can be read? That is, what code should be executed before:
>
>oErrorForm = NEWOBJECT( "dl_error_message", "dl_error.vcx",...)
>
It looks like you're instantiating an error handler/form when an error occurs. One thing you could do instead is instantiate it when your app starts and have it globally available - if it's a form, maybe hidden (?) That way it will be guaranteed to be available if an error occurs.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform