Better handle exceptions in the main async handler