handle errors with file downloads