PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → WD-20   Errors in a file
WD-20 Errors in a file
Iniciado por guest, 21,ago. 2016 08:53 - 2 respuestas
Publicado el 21,agosto 2016 - 08:53
Hi All,

While occurring fatal errors application shows an error message and we can copy that. Is there anyway to write all the errors in a file to trace issue occurs in customer application. This will helpful for trace the issues from customer side.


Expecting Replies


Thank you

Shijo S Philip
Publicado el 21,agosto 2016 - 09:49
Hello,

yes this is possible, if you "catch" the error in the "global declarations" of the window with

LOCAL
sError is string
iId is int

WHEN EXCEPTION

//Get the current error in a string
sError=ExceptionInfo(errFullDetails)

//Open a text file to write the log in it
nId = fOpen(CompleteDir(fExeDir())+"Error.log", foCreateIfNotExist+foAdd+foReadWrite)
fWriteLine(nId, DateToString(DateSys(),"DD.MM.YYYY")+" - "+TimeToString(TimeSys(),"HH:MM:SS")+CRLF+sError+CRLF+RepeatString("-",40))
fClose(nId)

//Display the error, let the customer decide what to do...
IF OPEN("DisplayError",sError) then
//Retry the error, maybe we can fix it
ExceptionEnable()
ELSE
//End the program, we cannot work around the error
EndProgram()
END

END

yours
Alex
Publicado el 21,agosto 2016 - 10:10
Hi Alex,

:cheers:

Thanks lot

Shijo S Philip