diff options
| author | Vojta Jina | 2011-06-02 18:39:44 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-06-02 12:51:12 -0700 |
| commit | b6db58c6472002cd81821a106816398942d4d0a4 (patch) | |
| tree | fcdc7caa1bef55e51a7691c8af5e5278da72eff0 | |
| parent | 4b0f2dfe0cbd4b5348af8cfb5af2e40904c73a47 (diff) | |
| download | angular.js-b6db58c6472002cd81821a106816398942d4d0a4.tar.bz2 | |
Fix formatError for FF4 and Opera
Other browsers prepend "Error: <Exception name>" to stack, but FF4 and Opera do not.
So when formatting error we prepend it by hand, when not present...
| -rw-r--r-- | src/Angular.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js index 3789dcbe..4dbdc220 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -180,7 +180,8 @@ function forEachSorted(obj, iterator, context) { function formatError(arg) { if (arg instanceof Error) { if (arg.stack) { - arg = arg.stack; + arg = (arg.message && arg.stack.indexOf(arg.message) === -1) ? + 'Error: ' + arg.message + '\n' + arg.stack : arg.stack; } else if (arg.sourceURL) { arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line; } |
