Properly handle download errors