reject request if reject is actually defined, fix #165

This commit is contained in:
Martin Zimmermann 2015-02-24 21:37:57 +01:00
parent 0466977109
commit 957fc72eb1

View File

@ -52,7 +52,9 @@ define(["app/lib/promise", "app/globals"], function(Q, globals) {
} }
if (xhr.status >= 500) { if (xhr.status >= 500) {
reject(xhr.body); if (reject) {
reject(xhr.body);
}
} else { } else {
resolve({status: xhr.status, body: xhr.responseText}); resolve({status: xhr.status, body: xhr.responseText});
} }