# Web app on OSX crashed : how to debug?

**URL:** <https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948>\
**Category:** Web\
**Created:** [December 14, 2014, 3:04pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948 "2014-12-14T15:04:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [December 14, 2014, 3:04pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/1 "2014-12-14T15:04:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [December 14, 2014, 5:23pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/2 "2014-12-14T17:23:42Z")

</div>

There should be something in Console.

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [December 14, 2014, 6:27pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/3 "2014-12-14T18:27:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Norman\_P](https://forum.xojo.com/letter_avatar_proxy/v4/letter/n/858c86/32.png) [@Norman\_P](https://forum.xojo.com/u/Norman_P)\
**Post date:** [December 14, 2014, 6:30pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/4 "2014-12-14T18:30:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [December 14, 2014, 6:35pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/5 "2014-12-14T18:35:17Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [December 14, 2014, 7:27pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/6 "2014-12-14T19:27:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mike\_D](https://forum.xojo.com/user_avatar/forum.xojo.com/mike_d/32/266_2.png) [@Mike\_D](https://forum.xojo.com/u/Mike_D)\
**Post date:** [December 14, 2014, 7:56pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/7 "2014-12-14T19:56:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:32pm UTC](https://forum.xojo.com/t/web-app-on-osx-crashed-how-to-debug/20948/8 "2020-10-29T17:32:00Z")

</div>


