change error catcher for javasript from log to error as output

This commit is contained in:
Clemens Schwaighofer
2025-02-13 18:24:50 +09:00
parent 07fbd13213
commit 5e21ead6fa

View File

@@ -1,8 +1,6 @@
/* general edit javascript */ /* general edit javascript */
/* jquery version */ /* jquery version */
/* jshint esversion: 11 */
/* global i18n */ /* global i18n */
// debug set // debug set
@@ -533,22 +531,20 @@ function errorCatch(err)
if (err.stack) { if (err.stack) {
// only FF // only FF
if (err.lineNumber) { if (err.lineNumber) {
console.log('ERROR[%s:%s] %s', err.name, err.lineNumber, err.message); console.error('ERROR[%s:%s] ', err.name, err.lineNumber, err);
} else if (err.line) { } else if (err.line) {
// only Safari // only Safari
console.log('ERROR[%s:%s] %s', err.name, err.line, err.message); console.error('ERROR[%s:%s] ', err.name, err.line, err);
} else { } else {
console.log('ERROR[%s] %s', err.name, err.message); console.error('ERROR[%s] ', err.name, err);
} }
// stack trace
console.log('ERROR[stack] %s', err.stack);
} else if (err.number) { } else if (err.number) {
// IE // IE
console.log('ERROR[%s:%s] %s', err.name, err.number, err.message); console.error('ERROR[%s:%s] %s', err.name, err.number, err.message);
console.log('ERROR[description] %s', err.description); console.error('ERROR[description] %s', err.description);
} else { } else {
// the rest // the rest
console.log('ERROR[%s] %s', err.name, err.message); console.error('ERROR[%s] %s', err.name, err.message);
} }
} }