diff --git a/core/Http.php b/core/Http.php
index df9df3e5aa417ee0780778092238f86303bdda09..b5533262e4a156b76fc75925bacbe7dcf309c5f1 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -426,7 +426,9 @@ class Http
 
             // save to file
             if (is_resource($file)) {
-                $handle = fopen($aUrl, 'rb', false, $ctx);
+                if (!($handle = fopen($aUrl, 'rb', false, $ctx))) {
+                    throw new Exception("Unable to open $aUrl");
+                }
                 while (!feof($handle)) {
                     $response = fread($handle, 8192);
                     $fileLength += strlen($response);