Error handling 2.7 vs. 2.8
Posted: Mon May 03, 2021 12:42 pm
Guys,
i got an rdd error and noticed that another ErrorDialog than mine shows the error now. Any ideas how my common Errordialog gets control of the exception again ? In the subclass i add a tab stop for better readability and i create my own log files. The name of such a log file depends on the name of the app.
When i debug the mentioned rdd error i see that a voerror.log is expected in the XSharp.RT GAC dir ?
Next debug step
i added the XSharpPublic/Runtime/XSharp.RT/Functions/Error.prg sources to my app and now the VOERROR.LOG is created in the app folder. Seems the usage of the WorkDir() function inside the XSharp.RT dll is responsible for pointing to the XSharp.RT GAC dir ?
ok, but my main problem is: i want the exception back :woohoo:
regards
Karl-Heinz
i got an rdd error and noticed that another ErrorDialog than mine shows the error now. Any ideas how my common Errordialog gets control of the exception again ? In the subclass i add a tab stop for better readability and i create my own log files. The name of such a log file depends on the name of the app.
Code: Select all
[STAThread];
FUNCTION Start() AS INT
LOCAL oDlg AS ErrorDialogTab // inherit Errordialog
LOCAL oXApp AS XApp
TRY
oXApp := XApp{}
oXApp:Start()
CATCH e AS Exception
oDlg := ErrorDialogTab { e }
oDlg:showDialog()
END TRY
RETURN 0
Code: Select all
System.IO.FileNotFoundException
Die Datei "C:WindowsMicrosoft.NetassemblyGAC_MSILXSharp.RTv4.0_2.6.0.0__ed555a0467764586VOERROR.LOG" konnte nicht gefunden werden.
Code: Select all
System.UnauthorizedAccessException
Der Zugriff auf den Pfad "C:WindowsMicrosoft.NetassemblyGAC_MSILXSharp.RTv4.0_2.6.0.0__ed555a0467764586VOERROR.LOG" wurde verweigert.
Code: Select all
INTERNAL FUNCTION __OpenErrorLog() AS IntPtr PASCAL
LOCAL cFile AS STRING
LOCAL cBuffer AS STRING
LOCAL hfRet AS IntPtr
cFile := WorkDir() + SetErrorLogFile() // <----------
regards
Karl-Heinz