diff --git a/lib/firebase.js b/lib/firebase.js
index <HASH>..<HASH> 100644
--- a/lib/firebase.js
+++ b/lib/firebase.js
@@ -82,7 +82,13 @@ exports.deployRules = function(rules, options) {
     const method = 'PUT';
     const body = typeof rules === 'string' ? rules : JSON.stringify({rules}, undefined, 2);
 
-    return request({uri, method, body});
+    return request({uri, method, body}).catch(e => {
+      if (e.statusCode != null) {
+        return Promise.reject(new Error(e.message));
+      }
+
+      return Promise.reject(e);
+    });
   });
 };
 
@@ -106,7 +112,13 @@ exports.deployData = function(data, options) {
     const method = 'PUT';
     const body = JSON.stringify(data || null);
 
-    return request({uri, method, body});
+    return request({uri, method, body}).catch(e => {
+      if (e.statusCode != null) {
+        return Promise.reject(new Error(e.message));
+      }
+
+      return Promise.reject(e);
+    });
   });
 };
 
@@ -169,6 +181,10 @@ exports.canRead = function(path, token, options) {
           return false;
         }
 
+        if (e.statusCode != null) {
+          return Promise.reject(new Error(e.message));
+        }
+
         return Promise.reject(e);
       }
     );
chore: do not expose http request on http error

HTTP error during firebase specs test would expose the full http request
details, including the auth token. Instead a http error will reject with
the HTTP status code and the response body.