pythoncross-platformerror-reporting

How to best implement simple crash / error reporting?


What would be the best way to implement a simple crash / error reporting mechanism?

Details: my app is cross-platform (mac/windows/linux) and written in Python, so I just need something that will send me a small amount of text, e.g. just a timestamp and a traceback (which I already generate and show in my error dialog).

It would be fine if it could simply email it, but I can't think of a way to do this without including a username and password for the smtp server in the application... Should I implement a simple web service on the server side and have my app send it an HTTP request with the info? Any better ideas?


Solution

  • The web service is the best way, but there are some caveats:

    1. You should always ask the user if it is ok to send error feedback information.
    2. You should be prepared to fail gracefully if there are network errors. Don't let a failure to report a crash impede recovery!
    3. You should avoid including user identifying or sensitive information unless the user knows (see #1) and you should either use SSL or otherwise protect it. Some jurisdictions impose burdens on you that you might not want to deal with, so it's best to simply not save such information.
    4. Like any web service, make sure your service is not exploitable by miscreants.