diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index dbf10a33abe5..18967e25e492 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -573,9 +573,8 @@ angular.module('ngResource', ['ng']). // jshint -W018 if (angular.isArray(data) !== (!!action.isArray)) { throw $resourceMinErr('badcfg', - 'Error in resource configuration. Expected ' + - 'response to contain an {0} but got an {1}', - action.isArray ? 'array' : 'object', + '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'); } // jshint +W018 diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 6e58976355bd..39232b40773b 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -1320,7 +1320,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalled(); expect(failureSpy.mostRecentCall.args[0]).toMatch( - /^\[\$resource:badcfg\] Error in resource configuration\. 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/ ); }); @@ -1337,7 +1337,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalled(); expect(failureSpy.mostRecentCall.args[0]).toMatch( - /^\[\$resource:badcfg\] Error in resource configuration. 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/ ); });