mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
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...
This commit is contained in:
parent
4b0f2dfe0c
commit
b6db58c647
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue