diff --git a/feeds.info b/feeds.info
index 4991435..e9ef158 100644
--- a/feeds.info
+++ b/feeds.info
@@ -73,6 +73,7 @@ files[] = tests/feeds_mapper_link.test
 files[] = tests/feeds_mapper_summary.test
 files[] = tests/feeds_mapper_taxonomy.test
 files[] = tests/feeds_tokens.test
+files[] = tests/FeedsEnclosureTest.test
 files[] = tests/http_request.test
 files[] = tests/parser_csv.test
 
diff --git a/libraries/http_request.inc b/libraries/http_request.inc
index 39cd0ed..4ed75fd 100644
--- a/libraries/http_request.inc
+++ b/libraries/http_request.inc
@@ -9,6 +9,29 @@
  */
 
 /**
+ * Error code for when the URL could not be parsed.
+ *
+ * @var int
+ */
+define('FEEDS_ERROR_PARSE_ERROR', -1001);
+
+/**
+ * Error code for when the scheme of an URL could not be determined.
+ *
+ * An example of a scheme is 'http'.
+ *
+ * @var int
+ */
+define('FEEDS_ERROR_NO_SCHEME', -1002);
+
+/**
+ * Error code for when the scheme of an URL is not supported.
+ *
+ * @var int
+ */
+define('FEEDS_ERROR_INVALID_SCHEME', -1003);
+
+/**
  * PCRE for finding the link tags in html.
  */
 define('HTTP_REQUEST_PCRE_LINK_TAG', '/<link((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*(>(.*)<\/link>|(\/)?>)/si');
@@ -147,9 +170,13 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva
     // cURL can only support either http:// or https://.
     // CURLOPT_PROTOCOLS is only supported with cURL 7.19.4
     $uri = parse_url($url);
-    if (!isset($uri['scheme'])) {
+    if ($uri === FALSE) {
+      $result->error = 'unable to parse URL';
+      $result->code = FEEDS_ERROR_PARSE_ERROR;
+    }
+    elseif (!isset($uri['scheme'])) {
       $result->error = 'missing schema';
-      $result->code = -1002;
+      $result->code = FEEDS_ERROR_NO_SCHEME;
     }
     else {
       switch ($uri['scheme']) {
@@ -160,7 +187,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva
 
         default:
           $result->error = 'invalid schema ' . $uri['scheme'];
-          $result->code = -1003;
+          $result->code = FEEDS_ERROR_INVALID_SCHEME;
           break;
       }
     }
diff --git a/plugins/FeedsParser.inc b/plugins/FeedsParser.inc
index e4fb66c..058903a 100644
--- a/plugins/FeedsParser.inc
+++ b/plugins/FeedsParser.inc
@@ -435,7 +435,41 @@ class FeedsEnclosure extends FeedsElement {
     feeds_include_library('http_request.inc', 'http_request');
     $result = http_request_get($this->getUrlEncodedValue());
     if ($result->code != 200) {
-      throw new Exception(t('Download of @url failed with code !code.', array('@url' => $this->getUrlEncodedValue(), '!code' => $result->code)));
+      $vars = array(
+        '@url' => $this->getUrlEncodedValue(),
+        '@code' => $result->code,
+        '@error' => isset($result->error) ? $result->error : 'Unknown error',
+      );
+
+      switch ($result->code) {
+        case FEEDS_ERROR_PARSE_ERROR:
+          $message = t('Download of @url failed because it could not be parsed.', $vars);
+          break;
+
+        case FEEDS_ERROR_NO_SCHEME:
+          $message = t("Download of @url failed because its scheme could not be determined. The URL is expected to start with something like '@example'.", $vars + array(
+            '@example' => 'http://',
+          ));
+          break;
+
+        case FEEDS_ERROR_INVALID_SCHEME:
+          $message = t('Download of @url failed because its scheme is not supported: @error. Examples of supported schemes are: @supported.', $vars + array(
+            '@scheme' => $result->uri['scheme'],
+            '@supported' => implode(', ', array('http', 'https')),
+          ));
+          break;
+
+        default:
+          if (isset($result->error)) {
+            $message = t('Download of @url failed with code @code and the following error: @error.', $vars);
+          }
+          else {
+            $message = t('Download of @url failed with code @code.', $vars);
+          }
+          break;
+      }
+
+      throw new Exception($message);
     }
     return $result->data;
   }
diff --git a/tests/FeedsEnclosureTest.test b/tests/FeedsEnclosureTest.test
new file mode 100644
index 0000000..0c20ae2
--- /dev/null
+++ b/tests/FeedsEnclosureTest.test
@@ -0,0 +1,75 @@
+<?php
+
+/**
+ * @coversDefaultClass FeedsEnclosure
+ * @group feeds
+ */
+class FeedsEnclosureTest extends FeedsWebTestCase {
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'FeedsEnclosure class test',
+      'description' => 'Covers class FeedsEnclosure.',
+      'group' => 'Feeds',
+    );
+  }
+
+  /**
+   * Tests getting content from an URL that failed to parse.
+   *
+   * @see ::getUrlParseErrorDataProvider()
+   */
+  public function testUrlParseError() {
+    foreach ($this->getUrlParseErrorDataProvider() as $testdata) {
+      $e = NULL;
+      $vars = $testdata['vars'] + array(
+        '@url' => $testdata['url'],
+      );
+
+      // Create a new enclosure.
+      $enclosure = new FeedsEnclosure($testdata['url'], 'text/plain');
+      try {
+        // The enclosure will try to download the content via HTTP.
+        @$enclosure->getContent();
+      }
+      catch (Exception $e) {
+        $this->pass(format_string("Exception thrown on url '@url'.", $vars));
+        $this->assertEqual(format_string($testdata['error'], $vars), $e->getMessage());
+      }
+      if (!isset($e)) {
+        $this->fail(format_string("Exception thrown on url '@url'.", $vars));
+      }
+    }
+  }
+
+  /**
+   * Data provider for ::testUrlParseError().
+   */
+  protected function getUrlParseErrorDataProvider() {
+    return array(
+      array(
+        'url' => 'http://',
+        'error' => 'Download of @url failed because it could not be parsed.',
+        'vars' => array(),
+      ),
+      array(
+        'url' => '//www.example.com/path?foo=bar',
+        'error' => "Download of @url failed because its scheme could not be determined. The URL is expected to start with something like '@example'.",
+        'vars' => array(
+          '@example' => 'http://',
+        ),
+      ),
+      array(
+        'url' => 'nonsupportedscheme://www.example.com',
+        'error' => 'Download of @url failed because its scheme is not supported: @error. Examples of supported schemes are: @supported.',
+        'vars' => array(
+          '@error' => 'invalid schema nonsupportedscheme',
+          '@supported' => implode(', ', array('http', 'https')),
+        ),
+      ),
+    );
+  }
+
+}
