0
1
Fork 0

Errores de logging solucionados

This commit is contained in:
Juan Ferrer Toribio 2015-08-28 03:48:42 +02:00
parent 39e436e275
commit a1d80a5f42
3 changed files with 28 additions and 14 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.208-1) stable; urgency=low hedera-web (1.211-1) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -237,9 +237,11 @@ Db.Conn.implement
} }
catch (e) catch (e)
{ {
this.signalEmit ('error', e);
error = e; error = e;
} }
if (error)
this.signalEmit ('error', error);
if (callback) if (callback)
try { try {

View File

@ -14,9 +14,14 @@ Vn.Web =
,initialize: function () ,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); }.bind (this);
this.loadingCount = 0; this.loadingCount = 0;
@ -161,6 +166,22 @@ Vn.Web =
this.onFormChange (); 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) ,errorHandler: function (error)
{ {
@ -185,16 +206,7 @@ Vn.Web =
{ {
console.error (error); console.error (error);
Htk.Toast.showError (_('InternalError')); Htk.Toast.showError (_('InternalError'));
this.notifyError (error);
var httpRequest = new Vn.HttpRequest ()
httpRequest.add
({
'file': error.fileName
,'line': error.lineNumber
,'message': error.message
,'stack': error.stack
});
httpRequest.send ('log.php');
} }
} }