You should define something separate for that. Good name is hard to find, but let's call it
go{}
(similarly go
go
keyword in Go language) that just starts a separate coroutine. It shall log unhandled exceptions somewhere similarly as to how a thread dumps its unhandled exceptions.