Handle unexpected exceptions in worker