Improved error handling of failed downloads