SC4G #50: Added error handling for file downloading