https://github.com/discourse/discourse/blob/master/app/jobs/regular/pull_hotlinked_images.rb#L39-L47
In above code whenever FileHelper.download
function fail I need to findout the reason for failing. Whether the file is not found (404) or failed for some other reason.