Web app on OSX crashed : how to debug?

I had two stand-alone web apps running on OS X and apparently one of them died last night. This morning, there is only one instance showing up in Activity Monitor. Is there any way for me to debug what went wrong with the other one? I don’t see any crash logs in obvious places.

There should be something in Console.

I’m running the app with “–logging” enabled, and I also have the app write status messages to a separate log.

I can see when it died, but there’s nothing in the Console. The only user online at that moment reports that they got the message that I set in WebApplication.DisconnectMessage, which makes it sound like the app either crashed or quit.

I don’t have code in Webapplication.UnhandledException. Would an unhanded exception log anything?

Only if you wrote code to do so as thats not the same as a crash log the system would gather if the process crashed.

Oops, I was wrong, I do have unhanded exception code:

WebApplication.UnhandledException
  dim s as string = str(error.ErrorNumber) + " : " + error.Message + join(error.stack,EndOfLine)
  try
    app.log session.username + " UnhandledException " + s
  catch
    app.quit
    return false // crashing in the error handler is bad, we better stop the entire app
  end try
  return false // show the event for this user, hopefully other sessions can continue

I’m 99% sure, however, that there was no exception logged, nor was there an app crash at the OS X level either. Odd.

Looking at my code, I suppose if “session” were nil, then the handler itself would have a nil object exception, and thus apple.quit would be triggered. But any other situation and it seems something should have been logged.

Session will certainly could be nil in WebApplication.UnhandledException. If you put this same code in Session.UnhandledException, you would have gotten something. Otherwise, maybe use introspection to get the exception type and remember to log the stack as well.

Session.UnhandledException ? I didn’t know there was such a thing. That’s useful, thank you.