#993 sys::Env - Top-level exception handler

tactics Tue 23 Feb 2010

Would it make sense to add a top-level exception handler to the sys::Env class? It would be nice to be able to hook into it and control how much stack information gets dumped (since most users don't care about anything past the first point in a system pod. It could also be really useful down the road for writing interpreters, debuggers, and web applications.

msl Wed 24 Feb 2010

Agreed - something similar to UncaughtExceptionHandler and would be very useful.

brian Wed 24 Feb 2010

I think it makes good sense, but I'm not sure there is really any good place in Fantom to do that:

  • the main thread used to launch Fantom which isn't associated with an actor
  • there are actors which pass their exceptions back to the future
  • most code actually occurs on weblet thread of FWT event handler (which logs the error)

So I'm more inclined to say it is up to you to wrap your main/actor with your own catch block.

Login or Signup to reply.