From 45dc9ee7b4a1e004f9fb7edde41d4805d1402ffa Mon Sep 17 00:00:00 2001 From: Ken Sheedlo Date: Fri, 9 Aug 2013 11:14:37 -0700 Subject: style(minerr): prefer component name as namespace Closes #3527 --- docs/content/error/ngResource/badargs.ngdoc | 9 --------- docs/content/error/ngResource/badcfg.ngdoc | 11 ----------- docs/content/error/ngSanitize/badparse.ngdoc | 11 ----------- docs/content/error/resource/badargs.ngdoc | 9 +++++++++ docs/content/error/resource/badcfg.ngdoc | 11 +++++++++++ docs/content/error/sanitize/badparse.ngdoc | 11 +++++++++++ src/ngResource/resource.js | 8 ++++---- src/ngSanitize/sanitize.js | 4 ++-- test/ngResource/resourceSpec.js | 4 ++-- 9 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 docs/content/error/ngResource/badargs.ngdoc delete mode 100644 docs/content/error/ngResource/badcfg.ngdoc delete mode 100644 docs/content/error/ngSanitize/badparse.ngdoc create mode 100644 docs/content/error/resource/badargs.ngdoc create mode 100644 docs/content/error/resource/badcfg.ngdoc create mode 100644 docs/content/error/sanitize/badparse.ngdoc diff --git a/docs/content/error/ngResource/badargs.ngdoc b/docs/content/error/ngResource/badargs.ngdoc deleted file mode 100644 index c5f89207..00000000 --- a/docs/content/error/ngResource/badargs.ngdoc +++ /dev/null @@ -1,9 +0,0 @@ -@ngdoc error -@name ngResource:badargs -@fullName Too Many Arguments -@description - -This error occurs when specifying too many arguments to a {@link api/ngResource.$resource `$resource`} action, such as `get`, `query` or any user-defined custom action. -These actions may take up to 4 arguments. - -For more information, refer to the {@link api/ngResource.$resource `$resource`} API reference documentation. diff --git a/docs/content/error/ngResource/badcfg.ngdoc b/docs/content/error/ngResource/badcfg.ngdoc deleted file mode 100644 index 07145466..00000000 --- a/docs/content/error/ngResource/badcfg.ngdoc +++ /dev/null @@ -1,11 +0,0 @@ -@ngdoc error -@name ngResource:badcfg -@fullName Response does not match configured parameter -@description - -This error occurs when the {@link api/ngResource.$resource `$resource`} service expects a response that can be deserialized as an array, receives an object, or vice versa. -By default, all resource actions expect objects, except `query` which expects arrays. - -To resolve this error, make sure your `$resource` configuration matches the actual format of the data returned from the server. - -For more information, see the {@link api/ngResource.$resource `$resource`} API reference documentation. diff --git a/docs/content/error/ngSanitize/badparse.ngdoc b/docs/content/error/ngSanitize/badparse.ngdoc deleted file mode 100644 index 39ba20d7..00000000 --- a/docs/content/error/ngSanitize/badparse.ngdoc +++ /dev/null @@ -1,11 +0,0 @@ -@ngdoc error -@name ngSanitize:badparse -@fullName Parsing Error while Sanitizing -@description - -This error occurs when the HTML string passed to '$sanitize' can't be parsed by the sanitizer. -The error contains part of the html string that can't be parsed. - -The parser is more strict than a typical browser parser, so it's possible that some obscure input would produce this error despite the string being recognized as valid HTML by a browser. - -If a valid html code results in this error, please file a bug. diff --git a/docs/content/error/resource/badargs.ngdoc b/docs/content/error/resource/badargs.ngdoc new file mode 100644 index 00000000..a9a3f213 --- /dev/null +++ b/docs/content/error/resource/badargs.ngdoc @@ -0,0 +1,9 @@ +@ngdoc error +@name $resource:badargs +@fullName Too Many Arguments +@description + +This error occurs when specifying too many arguments to a {@link api/ngResource.$resource `$resource`} action, such as `get`, `query` or any user-defined custom action. +These actions may take up to 4 arguments. + +For more information, refer to the {@link api/ngResource.$resource `$resource`} API reference documentation. diff --git a/docs/content/error/resource/badcfg.ngdoc b/docs/content/error/resource/badcfg.ngdoc new file mode 100644 index 00000000..82e87504 --- /dev/null +++ b/docs/content/error/resource/badcfg.ngdoc @@ -0,0 +1,11 @@ +@ngdoc error +@name $resource:badcfg +@fullName Response does not match configured parameter +@description + +This error occurs when the {@link api/ngResource.$resource `$resource`} service expects a response that can be deserialized as an array, receives an object, or vice versa. +By default, all resource actions expect objects, except `query` which expects arrays. + +To resolve this error, make sure your `$resource` configuration matches the actual format of the data returned from the server. + +For more information, see the {@link api/ngResource.$resource `$resource`} API reference documentation. diff --git a/docs/content/error/sanitize/badparse.ngdoc b/docs/content/error/sanitize/badparse.ngdoc new file mode 100644 index 00000000..d07c6d62 --- /dev/null +++ b/docs/content/error/sanitize/badparse.ngdoc @@ -0,0 +1,11 @@ +@ngdoc error +@name $sanitize:badparse +@fullName Parsing Error while Sanitizing +@description + +This error occurs when the HTML string passed to '$sanitize' can't be parsed by the sanitizer. +The error contains part of the html string that can't be parsed. + +The parser is more strict than a typical browser parser, so it's possible that some obscure input would produce this error despite the string being recognized as valid HTML by a browser. + +If a valid html code results in this error, please file a bug. diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 003b41f1..57da8f09 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -1,6 +1,6 @@ 'use strict'; -var ngResourceMinErr = angular.$$minErr('ngResource'); +var $resourceMinErr = angular.$$minErr('$resource'); /** * @ngdoc overview @@ -449,7 +449,7 @@ angular.module('ngResource', ['ng']). break; case 0: break; default: - throw ngResourceMinErr('badargs', + throw $resourceMinErr('badargs', "Expected up to 4 arguments [params, data, success, error], got {0} arguments", arguments.length); } @@ -474,8 +474,8 @@ angular.module('ngResource', ['ng']). if (data) { if ( angular.isArray(data) != !!action.isArray ) { - throw ngResourceMinErr('badcfg', 'Error in resource configuration. Expected response' + - ' to contain an {0} but got an {1}', + throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected response' + + ' to contain an {0} but got an {1}', action.isArray?'array':'object', angular.isArray(data)?'array':'object'); } if (action.isArray) { diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 70932899..8220b1f5 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -1,6 +1,6 @@ 'use strict'; -var ngSanitizeMinErr = angular.$$minErr('ngSanitize'); +var $sanitizeMinErr = angular.$$minErr('$sanitize'); /** * @ngdoc overview @@ -274,7 +274,7 @@ function htmlParser( html, handler ) { } if ( html == last ) { - throw ngSanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html); + throw $sanitizeMinErr('badparse', "The sanitizer was unable to parse the following block of html: {0}", html); } last = html; } diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 19456f01..68c1b171 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -1061,7 +1061,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalledWith( - '[ngResource:badcfg] Error in resource configuration. Expected response to contain an array but got an object'); + '[$resource:badcfg] Error in resource configuration. Expected response to contain an array but got an object'); }); it('should fail if action expects an array but response is an object', function() { @@ -1076,7 +1076,7 @@ describe('resource', function() { expect(successSpy).not.toHaveBeenCalled(); expect(failureSpy).toHaveBeenCalledWith( - '[ngResource:badcfg] Error in resource configuration. Expected response to contain an object but got an array'); + '[$resource:badcfg] Error in resource configuration. Expected response to contain an object but got an array'); }); -- cgit v1.2.3