Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b6db58c

Browse files
vojtajinaIgorMinar
authored andcommitted
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...
1 parent 4b0f2df commit b6db58c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Angular.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ function forEachSorted(obj, iterator, context) {
180180
function formatError(arg) {
181181
if (arg instanceof Error) {
182182
if (arg.stack) {
183-
arg = arg.stack;
183+
arg = (arg.message && arg.stack.indexOf(arg.message) === -1) ?
184+
'Error: ' + arg.message + '\n' + arg.stack : arg.stack;
184185
} else if (arg.sourceURL) {
185186
arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
186187
}

0 commit comments

Comments
 (0)