From 2c64f3dc176843f4b0d31ba026736ce6f6617f59 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 12 Aug 2013 13:27:46 -0700 Subject: docs(minErr): add location/isrcharg docs --- docs/content/error/location/isrcharg.ngdoc | 9 +++++++++ docs/content/error/location/wpt.ngdoc | 4 ---- src/ng/location.js | 2 +- test/ng/locationSpec.js | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 docs/content/error/location/isrcharg.ngdoc delete mode 100644 docs/content/error/location/wpt.ngdoc diff --git a/docs/content/error/location/isrcharg.ngdoc b/docs/content/error/location/isrcharg.ngdoc new file mode 100644 index 00000000..4f6f4b43 --- /dev/null +++ b/docs/content/error/location/isrcharg.ngdoc @@ -0,0 +1,9 @@ +@ngdoc error +@name $location:isrcharg +@fullName Wrong $location.search() argument type +@description + +To resolve this error, ensure that the first argument for the `$location.search` call is a `string` or an object. +You can use the stack trace associated with this error to identify the call site that caused this issue. + +To learn more, please consult the {@link api/ng.$location `$location`} api docs. diff --git a/docs/content/error/location/wpt.ngdoc b/docs/content/error/location/wpt.ngdoc deleted file mode 100644 index 8b3b3b2a..00000000 --- a/docs/content/error/location/wpt.ngdoc +++ /dev/null @@ -1,4 +0,0 @@ -@ngdoc error -@name $location:wpt -@fullName Wrong parameter type -@description diff --git a/src/ng/location.js b/src/ng/location.js index e64a97d5..48d03971 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -375,7 +375,7 @@ LocationHashbangInHtml5Url.prototype = } else if (isObject(search)) { this.$$search = search; } else { - throw $locationMinErr('wpt', 'First parameter of function must be string or an object.'); + throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.'); } break; default: diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js index 383783bb..e473a155 100644 --- a/test/ng/locationSpec.js +++ b/test/ng/locationSpec.js @@ -88,10 +88,10 @@ describe('$location', function() { it('search() should throw error an incorrect argument', function() { expect(function() { url.search(null); - }).toThrow('[$location:wpt] First parameter of function must be string or an object.'); + }).toThrow('[$location:isrcharg] The first argument of the `$location#search()` call must be a string or an object.'); expect(function() { url.search(undefined); - }).toThrow('[$location:wpt] First parameter of function must be string or an object.'); + }).toThrow('[$location:isrcharg] The first argument of the `$location#search()` call must be a string or an object.'); }); -- cgit v1.2.3