diff options
| author | Igor Minar | 2013-05-24 11:00:14 -0700 |
|---|---|---|
| committer | Vojta Jina | 2013-05-24 17:03:21 -0700 |
| commit | b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5 (patch) | |
| tree | f3b34e25e27d088bec9b698b246d49f86281de36 /src/ng/location.js | |
| parent | 88eaea8e7bf025a7805a5d20f5d47472e4f26f6f (diff) | |
| download | angular.js-b8ea7f6aba2e675b85826b0bee1f21ddd7b866a5.tar.bz2 | |
feat(ngError): add error message compression and better error messages
- add toThrowNg matcher
Diffstat (limited to 'src/ng/location.js')
| -rw-r--r-- | src/ng/location.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ng/location.js b/src/ng/location.js index 4efa019c..7b011abe 100644 --- a/src/ng/location.js +++ b/src/ng/location.js @@ -95,7 +95,7 @@ function LocationHtml5Url(appBase, basePrefix) { matchUrl(url, parsed); var pathUrl = beginsWith(appBaseNoFile, url); if (!isString(pathUrl)) { - throw Error('Invalid url "' + url + '", missing path prefix "' + appBaseNoFile + '".'); + throw ngError(21, '$location error! Invalid url "{0}", missing path prefix "{1}".', url, appBaseNoFile); } matchAppUrl(pathUrl, parsed); extend(this, parsed); @@ -157,11 +157,11 @@ function LocationHashbangUrl(appBase, hashPrefix) { matchUrl(url, this); var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url); if (!isString(withoutBaseUrl)) { - throw new Error('Invalid url "' + url + '", does not start with "' + appBase + '".'); + throw ngError(22, '$location error! Invalid url "{0}", does not start with "{1}".', url, appBase); } var withoutHashUrl = withoutBaseUrl.charAt(0) == '#' ? beginsWith(hashPrefix, withoutBaseUrl) : withoutBaseUrl; if (!isString(withoutHashUrl)) { - throw new Error('Invalid url "' + url + '", missing hash prefix "' + hashPrefix + '".'); + throw ngError(49, '$location error! Invalid url "{0}", missing hash prefix "{1}".', url, hashPrefix); } matchAppUrl(withoutHashUrl, this); this.$$compose(); |
