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..84a9513 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');
@@ -24,6 +47,11 @@ define('HTTP_REQUEST_PCRE_TAG_ATTRIBUTES', '/[\x09\x0A\x0B\x0C\x0D\x20]+([^\x09\
 class HRCurlException extends Exception {}
 
 /**
+ * For HTTP requests that do not return a 2xx code.
+ */
+class FeedsHTTPRequestException extends Exception {}
+
+/**
  * Discovers RSS or atom feeds at the given URL.
  *
  * If document in given URL is an HTML document, function attempts to discover
@@ -147,9 +175,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 +192,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;
       }
     }
@@ -284,6 +316,56 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva
 }
 
 /**
+ * Checks the result of the HTTP Request.
+ *
+ * @param string $url
+ *   The URL that was requested.
+ * @param object $result
+ *   The HTTP Request result.
+ *
+ * @throws FeedsHTTPRequestException
+ *   In case the result code of the HTTP request is not in the 2xx series.
+ */
+function http_request_check_result($url, $result) {
+  if (!in_array($result->code, array(200, 201, 202, 203, 204, 205, 206))) {
+    $vars = array(
+      '@url' => $url,
+      '@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(
+          '@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 FeedsHTTPRequestException($message);
+  }
+}
+
+/**
  * Decides if it's possible to use cURL or not.
  *
  * @return bool
diff --git a/plugins/FeedsHTTPFetcher.inc b/plugins/FeedsHTTPFetcher.inc
index cd91b63..9f7d0d1 100644
--- a/plugins/FeedsHTTPFetcher.inc
+++ b/plugins/FeedsHTTPFetcher.inc
@@ -42,15 +42,16 @@ class FeedsHTTPFetcherResult extends FeedsFetcherResult {
   }
 
   /**
-   * Overrides FeedsFetcherResult::getRaw();
+   * Overrides FeedsFetcherResult::getRaw().
+   *
+   * @throws FeedsHTTPRequestException
+   *   In case the result code of the HTTP request is not in the 2xx series.
    */
   public function getRaw() {
     if (!isset($this->raw)) {
       feeds_include_library('http_request.inc', 'http_request');
       $result = http_request_get($this->url, NULL, NULL, $this->acceptInvalidCert, $this->timeout);
-      if (!in_array($result->code, array(200, 201, 202, 203, 204, 205, 206))) {
-        throw new Exception(t('Download of @url failed with code !code.', array('@url' => $this->url, '!code' => $result->code)));
-      }
+      http_request_check_result($this->url, $result);
       $this->raw = $result->data;
     }
 
diff --git a/plugins/FeedsParser.inc b/plugins/FeedsParser.inc
index e4fb66c..5de55ee 100644
--- a/plugins/FeedsParser.inc
+++ b/plugins/FeedsParser.inc
@@ -430,13 +430,14 @@ class FeedsEnclosure extends FeedsElement {
    *
    * @return string
    *   The content of the referenced resource.
+   *
+   * @throws FeedsHTTPRequestException
+   *   In case the result code of the HTTP request is not in the 2xx series.
    */
   public function getContent() {
     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)));
-    }
+    http_request_check_result($this->getUrlEncodedValue(), $result);
     return $result->data;
   }
 
diff --git a/tests/FeedsEnclosureTest.test b/tests/FeedsEnclosureTest.test
new file mode 100644
index 0000000..ef64651
--- /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')),
+        ),
+      ),
+    );
+  }
+
+}
