Updated the upload process to properly throw an error