diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index dd725c48980d..003671476c32 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -581,8 +581,8 @@ angular.module('ngResource', ['ng']). if (angular.isArray(data) !== (!!action.isArray)) { throw $resourceMinErr('badcfg', 'Error in resource configuration for action `{0}`. Expected response to ' + - 'contain an {1} but got an {2}', name, action.isArray ? 'array' : 'object', - angular.isArray(data) ? 'array' : 'object'); + 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object', + angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url); } // jshint +W018 if (action.isArray) { diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index ba72525e6de9..523b39c28858 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -1322,7 +1322,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalled(); expect(failureSpy.mostRecentCall.args[0]).toMatch( - /^\[\$resource:badcfg\] Error in resource configuration for action `query`\. Expected response to contain an array but got an object/ + /^\[\$resource:badcfg\] Error in resource configuration for action `query`\. Expected response to contain an array but got an object \(Request: GET \/Customer\/123\)/ ); }); @@ -1339,7 +1339,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalled(); expect(failureSpy.mostRecentCall.args[0]).toMatch( - /^\[\$resource:badcfg\] Error in resource configuration for action `get`\. Expected response to contain an object but got an array/ + /^\[\$resource:badcfg\] Error in resource configuration for action `get`\. Expected response to contain an object but got an array \(Request: GET \/Customer\/123\)/ ); });