diff --git a/core/lib/Drupal/Component/Guzzle/BadResponseExceptionWrapper.php b/core/lib/Drupal/Component/Guzzle/BadResponseExceptionWrapper.php
new file mode 100644
index 0000000..f70a87f
--- /dev/null
+++ b/core/lib/Drupal/Component/Guzzle/BadResponseExceptionWrapper.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @file
+ * Definition of Drupal\Component\Guzzle\BadResponseExceptionWrapper.
+ */
+
+namespace Drupal\Component\Guzzle;
+use Guzzle\Http\Exception\CurlException;
+use Guzzle\Http\Exception\BadResponseException;
+
+class BadResponseExceptionWrapper {
+
+  protected $exception;
+
+  /**
+   * @param \Guzzle\Http\Exception\BadResponseException $e
+   */
+  function __construct(BadResponseException $e) {
+    $this->exception = $e;
+  }
+
+  /**
+   * Get a brief, human readable message explaining the error.
+   *
+   * @return string
+   */
+  function getStatusMessage() {
+    if($this->exception instanceof CurlException) {
+      return $this->exception->getError();
+    }
+    return $this->exception->getResponse()->getReasonPhrase();
+  }
+
+  /**
+   * Obtain a status code for the exception.
+   *
+   * For cURL errors, this will be the negative version of the error code.
+   * For all other errors, it will be the HTTP status code.
+   *
+   * @return int
+   */
+  function getStatusCode() {
+    if($this->exception instanceof CurlException) {
+      // When a network error occurs, we use a negative number so it does not
+      // clash with the HTTP status codes.
+      return -$this->exception->getErrorNo();
+    }
+    return $this->exception->getResponse()->getStatusCode();
+  }
+}
\ No newline at end of file
