Index: remoting/webapp/crd/js/xhr.js |
diff --git a/remoting/webapp/crd/js/xhr.js b/remoting/webapp/crd/js/xhr.js |
index cc50b27745e4fce258f1715982795f436b6dd915..4b3603e7b5e913693f9642f53f5a95e8fee005f5 100644 |
--- a/remoting/webapp/crd/js/xhr.js |
+++ b/remoting/webapp/crd/js/xhr.js |
@@ -294,6 +294,14 @@ remoting.Xhr.Response = function(xhr, allowJson) { |
}; |
/** |
+ * @return {boolean} True if the response code is outside the 200-299 |
+ * range (i.e. success as defined by the HTTP protocol). |
+ */ |
+remoting.Xhr.Response.prototype.isError = function() { |
+ return this.status < 200 || this.status >= 300; |
+}; |
+ |
+/** |
* @return {string} The text content of the response. |
*/ |
remoting.Xhr.Response.prototype.getText = function() { |