Handling exceptions in asynchronous operations