Added catch blocks for uncaught runtime exceptions during event loop callbacks.