Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 7 Monaten, 1 Woche
Letzter Beitrag:
vor 7 Monaten
Beteiligte Autoren:
John Fligg, JP, Piet van Zanten

Reporting application crashes

Startbeitrag von John Fligg am 14.11.2017 09: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.

Antworten:

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

von Piet van Zanten - am 14.11.2017 09:46
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.

von John Fligg - am 14.11.2017 14:34
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!

von JP - am 17.11.2017 09:12
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.