PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Reporting application crashes
Reporting application crashes
Iniciado por guest, 14,nov. 2017 10:19 - 3 respuestas
Publicado el 14,noviembre 2017 - 10:19
When an app crashes on a Clients device (or in development) you get this screen

[attachment 2499 error.png]

The Client can click Copy to Clipboard. But I have a SendMail procedure. Is there any way to automatically get the attachment or some copy of this to send automatically without the Client having to do anything?

IOW when this happens it is detected and I can send an email to myself with the details.

Thx.
Publicado el 14,noviembre 2017 - 10:46
Hi John,

Depends on what platform,
Webdev is easy because you control the mailserver, Windev is not so easy.

For Webdev I use:
In the project initialization:
//General error processing IF NOT OnTestMode() THEN WHEN EXCEPTION Error_Handling() END END And the global procedure:
PROCEDURE Error_Handling() sServer,sUser,sPass,sIniName is string nPort is int IF ExceptionInfo(errCode)<>57 THEN //disconnected, timeout //send email EmailReset() Email.Recipient[1]="support@xxx.com" Email.NbRecipient=1 Email.Sender="info@xxx.com" Email.Message=... "Date/time: "+ DateToString(DateSys(),"DD-MM-YYYY")+" "+TimeString(TimeSys(),"HH:mm")+RC+... "IP address"+BrowserIPAddress()+RC+... "Client ID: "+sClientID+RC+RC+... ExceptionInfo(errFullDetails) Email.HTML="" Email.Subject="Error website xxxxxxxxx" sIniName=fExeDir()+"/connect.ini" sServer=INIRead("mail","smtp","",sIniName) nPort=INIRead("mail","port","25",sIniName) sUser=INIRead("mail","smtp_user","",sIniName) sPass=INIRead("mail","smtp_password","",sIniName) IF EmailStartSMTPSession(sUser,sPass,sServer) THEN EmailSendMessage(sUser) EmailCloseSession(sUser) END END proc_Error("An unexpected error has occurred."+RC+"The current activity could not be continued."+RC+"We are sorry for the trouble. the error has been reported to XXX and will be investigated as soon as possible.") PageUse(PAGE_Start)
Kind regards,
Piet
Publicado el 14,noviembre 2017 - 15:34
Ah hah. Well that's easy on all platforms. I can use my email procedure but it's attaching something to it. There is also my own issue of never being able to get an error reported without the app crashing.

So by using your approach I can get this working on all platforms. I have never set this error trapping at a global level. At a local level it never seems to work and as above crashed before reporting anything.

Thank you.
Publicado el 17,noviembre 2017 - 10:12
Piet

Is there a way to prevent the WinDev error dialog itself appearing? i.e. do you solution above, write an error log and/or send an email to the admin, and then exit the system without the WinDev error dialog appearing at all?

UPDATE - I have resolved this. Thanks!