Fixed unhandled exceptions when uploading after failed generation