mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 05:31:15 -07:00
Log JS errors from the WebUI
This commit is contained in:
parent
91a5529438
commit
322f106e75
2 changed files with 21 additions and 1 deletions
|
@ -391,3 +391,16 @@ function clearSearchButton(tableName, table) {
|
||||||
table.search('').draw();
|
table.search('').draw();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Taken from https://github.com/Hellowlol/HTPC-Manager
|
||||||
|
window.onerror = function (message, file, line) {
|
||||||
|
var e = {
|
||||||
|
'page': window.location.href,
|
||||||
|
'message': message,
|
||||||
|
'file': file,
|
||||||
|
'line': line
|
||||||
|
};
|
||||||
|
|
||||||
|
$.post("log_js_errors", e, function (data) {
|
||||||
|
});
|
||||||
|
};
|
|
@ -1081,7 +1081,14 @@ class WebInterface(object):
|
||||||
logger.debug(u"If you read this message, debug logging is available")
|
logger.debug(u"If you read this message, debug logging is available")
|
||||||
raise cherrypy.HTTPRedirect("logs")
|
raise cherrypy.HTTPRedirect("logs")
|
||||||
|
|
||||||
|
@cherrypy.expose
|
||||||
|
def log_js_errors(self, page, message, file, line):
|
||||||
|
""" Logs javascript errors from the web interface. """
|
||||||
|
logger.error(u"WebUI :: /%s : %s. (%s:%s)" % (page.rpartition('/')[-1],
|
||||||
|
message,
|
||||||
|
file.rpartition('/')[-1].partition('?')[0],
|
||||||
|
line))
|
||||||
|
return True
|
||||||
|
|
||||||
##### Settings #####
|
##### Settings #####
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue