diff options
| author | Misko Hevery | 2010-11-16 13:57:41 -0800 | 
|---|---|---|
| committer | Igor Minar | 2010-11-16 14:19:55 -0800 | 
| commit | b2d63ac48bdc61b5a4afdd10b8485c0c1ab8cdca (patch) | |
| tree | 0b798ba07d5b593dcc3e27964e81eb0542440d56 /src/directives.js | |
| parent | 4af32de84a264e05eebfa6dbc09ce10fac1e1417 (diff) | |
| download | angular.js-b2d63ac48bdc61b5a4afdd10b8485c0c1ab8cdca.tar.bz2 | |
Changed error handling so that better stack traces are displayed in the ng-errors
Diffstat (limited to 'src/directives.js')
| -rw-r--r-- | src/directives.js | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/src/directives.js b/src/directives.js index e359d6cc..2958773d 100644 --- a/src/directives.js +++ b/src/directives.js @@ -182,7 +182,7 @@ angularDirective("ng:bind", function(expression, element){            oldElement = this.hasOwnProperty($$element) ? this.$element : _undefined;        this.$element = element;        value = this.$tryEval(expression, function(e){ -        error = toJson(e); +        error = formatError(e);        });        this.$element = oldElement;        // If we are HTML than save the raw HTML data so that we don't @@ -466,15 +466,15 @@ angularWidget("@ng:repeat", function(expression, element){      var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),          lhs, rhs, valueIdent, keyIdent;      if (! match) { -      throw "Expected ng:repeat in form of 'item in collection' but got '" + -      expression + "'."; +      throw Error("Expected ng:repeat in form of 'item in collection' but got '" + +      expression + "'.");      }      lhs = match[1];      rhs = match[2];      match = lhs.match(/^([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\)$/);      if (!match) { -      throw "'item' in 'item in collection' should be identifier or (key, value) but got '" + -      keyValue + "'."; +      throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '" + +      keyValue + "'.");      }      valueIdent = match[3] || match[1];      keyIdent = match[2];  | 
