copy_file_from_url, handle exception, return an error code.