I duplicated the code, and wrapped the function to catch the error.