aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Minar2013-08-12 13:27:46 -0700
committerIgor Minar2013-08-12 14:09:09 -0700
commit2c64f3dc176843f4b0d31ba026736ce6f6617f59 (patch)
tree94929ba571c23a0560cf5227b5bb907c776ccb51
parent72dc48ea4d7e97c9dd3a9f469698ed77bcbdedbe (diff)
downloadangular.js-2c64f3dc176843f4b0d31ba026736ce6f6617f59.tar.bz2
docs(minErr): add location/isrcharg docs
-rw-r--r--docs/content/error/location/isrcharg.ngdoc9
-rw-r--r--docs/content/error/location/wpt.ngdoc4
-rw-r--r--src/ng/location.js2
-rw-r--r--test/ng/locationSpec.js4
4 files changed, 12 insertions, 7 deletions
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.');
});