2

I can't find any way of determining whether it was possible to send a bug report from my D2006 app. If MadExcept can make some sort of return code available I can maybe provide some guidance to the user as to what might be wrong.

rossmcm
  • 5,493
  • 10
  • 55
  • 118
  • 1
    If your code can react to MadExcept catching an exception, your app should catch and handle the exception itself. MadExcept is for tracking down issues you don't know about and therefore can't handle. IOW, there's no need for a return code; if you have a chance to check that, you should have already caught and dealt with the exception itself. – Ken White Feb 24 '11 at 03:47
  • 1
    Having result status information like 'Could not contact SMTP server', 'Unable to relay', or (in case of a POST on a web server), 'HTTP error 503' which can be displayed to the user or logged would be nice to have. Of course this can not be used at the location where the exception occured. But it typically would be passed to an event handler (like OnAfterSendReport) where user code can decide what to do with the information. According to the docs, RegisterExceptionHandler with eaContinueApplication could be a way to do this (in the next version of madExcept) – mjn Feb 24 '11 at 06:13
  • @Ken, I'm not really talking about ME handling the exception in my program. I assume that ME has trapped the exception and is presenting the user with a dialog, on which one of the buttons sends a bug report. What I want is some way of knowing that it didn't send, and why it didn't send, so I can maybe instruct the user to save the bug report and email it manually. – rossmcm Feb 24 '11 at 07:18
  • you can configure ME to both save the bug report automatically (either by appending to an existing report or truncating and starting a new one) as well as offering the chance to send it. So you have a copy of the report even if the email fails. – Ken White Feb 24 '11 at 14:09
  • 1
    @Ken. Granted, I can have ME save the bug report automatically (and I can save it myself when I trap the exception), but I just thought it would be nice to be able to pop up a dialog that said "I couldn't send the bug report - would you mind going to and sending to bugreports@mydomain.com" – rossmcm Feb 24 '11 at 20:32

2 Answers2

1

The problem is that MadExcept can't reasonably determine that. There's a whole chain of things that can go wrong after Madexcept sends the email. You will get an exception if MadExcept can't build the report or there's an immediate problem sending the email.

  • email client comes up with the message, user doesn't hit send
  • email client is broken or misconfigured
  • SMTP host is broken, down or missing
  • your client is on an RBL that you subscribe to (perhaps unknowingly)
  • your client's domain is on an RBL or otherwise blocked
  • your mail system hiccups and you lose that email

The best you can get from MadExcept is "no exception thrown, sending might have gone ok".

  • OK when you say "no exception thrown", how might I determine that? – rossmcm Feb 24 '11 at 20:33
  • From what I recall, if MadExcept throws an exception your app closes. But this is something that the Madshi forums/docs are better for than SO. I suggest asking on http://forum.madshi.net –  Feb 24 '11 at 21:05
1

Maybe not a complete solution but useful information: if the bugreport is sent using a HTTP POST request to a web server, madExcept can detect if the response contains a HTTP redirect header, and in this case madExcept will launch the default web browser and load the URL given in the redirect.

So the user can immediately see that the report has been received and stored.

The web server could even analyze the bugreport and give additional information such as "This bug is already known and we have an update of the application which will fix it, you can download it here". (I wrote a web application, madxnet, for this purpose - it is still available for testing).

mjn
  • 36,362
  • 28
  • 176
  • 378
  • 1
    Interesting web app. Any chance you'd be willing to share the code? If you like without the analysis part (I can imagine there would be some propriatary stuff there)? – Marjan Venema Feb 24 '11 at 07:46
  • @Marjan it is not Delphi but Java code (a simple web application running on Google App Engine) and the project is currently inactive until I find some sponsors :) – mjn Feb 24 '11 at 15:30