aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/services.js4
-rw-r--r--test/angular-mocks.js2
-rw-r--r--test/servicesSpec.js2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/services.js b/src/services.js
index 93822a8c..940f1905 100644
--- a/src/services.js
+++ b/src/services.js
@@ -234,7 +234,7 @@ angularService('$xhr', function($browser, $error, $log){
angularService('$xhr.error', function($log){
return function(request, response){
- $log.error(response);
+ $log.error('ERROR: XHR: ' + request.url, request, response);
};
}, {inject:['$log']});
@@ -272,7 +272,7 @@ angularService('$xhr.bulk', function($xhr, $error, $log){
if (response.status == 200) {
(currentRequests[i].callback || noop)(response.status, response.response);
} else {
- $error(currentRequests[i], {status: response.status, body:response.response});
+ $error(currentRequests[i], response);
}
} catch(e) {
$log.error(e);
diff --git a/test/angular-mocks.js b/test/angular-mocks.js
index c5784ac9..8838b2cd 100644
--- a/test/angular-mocks.js
+++ b/test/angular-mocks.js
@@ -54,7 +54,7 @@ function MockBrowser() {
var expect = expectations[method] || (expectations[method] = {});
return {
respond: function(code, response) {
- if (!isNumber(code)) {
+ if (!angular.isNumber(code)) {
response = code;
code = 200;
}
diff --git a/test/servicesSpec.js b/test/servicesSpec.js
index 45993490..c2c13461 100644
--- a/test/servicesSpec.js
+++ b/test/servicesSpec.js
@@ -288,7 +288,7 @@ describe("service", function(){
expect(typeof cb).toEqual('function');
expect($xhrError).wasCalledWith(
{url:'/req1', method:'GET', data:null, callback:cb},
- {status:404, body:'NotFound'});
+ {status:404, response:'NotFound'});
expect(log).toEqual('"second";DONE');
});