From a1d80a5f42b1033491f6f34b2d14428322239552 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 28 Aug 2015 03:48:42 +0200 Subject: [PATCH] Errores de logging solucionados --- debian/changelog | 2 +- web/js/db/conn.js | 4 +++- web/pages/web/web.js | 36 ++++++++++++++++++++++++------------ 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ff09a22..a238d56a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.208-1) stable; urgency=low +hedera-web (1.211-1) stable; urgency=low * Initial Release. diff --git a/web/js/db/conn.js b/web/js/db/conn.js index 8ec75641..ca73d908 100755 --- a/web/js/db/conn.js +++ b/web/js/db/conn.js @@ -237,9 +237,11 @@ Db.Conn.implement } catch (e) { - this.signalEmit ('error', e); error = e; } + + if (error) + this.signalEmit ('error', error); if (callback) try { diff --git a/web/pages/web/web.js b/web/pages/web/web.js index 25429f05..7da1209c 100755 --- a/web/pages/web/web.js +++ b/web/pages/web/web.js @@ -14,9 +14,14 @@ Vn.Web = ,initialize: function () { - window.onerror = function (error, a, b, c, d) + window.onerror = function (message, file, line) { - this.errorHandler.bind (this, error); + var error = new Error (message); + error.fileName = file; + error.lineNumber = line; + + Htk.Toast.showError (_('InternalError')); + this.notifyError (error); }.bind (this); this.loadingCount = 0; @@ -161,6 +166,22 @@ Vn.Web = this.onFormChange (); } + + ,notifyError: function (error) + { + if (error instanceof Error) + { + var httpRequest = new Vn.HttpRequest () + httpRequest.add + ({ + 'file': error.fileName + ,'line': error.lineNumber + ,'message': error.message + ,'stack': error.stack + }); + httpRequest.send ('log.php'); + } + } ,errorHandler: function (error) { @@ -185,16 +206,7 @@ Vn.Web = { console.error (error); Htk.Toast.showError (_('InternalError')); - - var httpRequest = new Vn.HttpRequest () - httpRequest.add - ({ - 'file': error.fileName - ,'line': error.lineNumber - ,'message': error.message - ,'stack': error.stack - }); - httpRequest.send ('log.php'); + this.notifyError (error); } }