diff options
-rw-r--r-- | js/codeq/core.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js index c3c657f..b53ce70 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ (function () { - window.siteDefinition = {logLevel: 'debug'}; // for debug purposes + window.siteDefinition = {logLevel: 'debug'/*, 'logService': '/ws/clientlog'*/}; // for debug purposes // ================================================================================ // JSON-ization (stringification) function @@ -123,7 +123,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ logs = []; $.ajax({ contentType: 'application/json', - dataType: 'application/json', type: 'POST', url: logServiceUrl, data: copyOfLogs, @@ -148,6 +147,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ return logger; })(); + // uncaught error reporting + window.onerror = function (msg, url, lineNumber) { + if ((msg !== null) && (msg instanceof Object)) msg = msg.toString(); + codeq.log.error('Uncaught error at line ' + lineNumber + ' in ' + url + ': ' + msg); + }; + // ================================================================================ // The core CodeQ module // ================================================================================ |