summaryrefslogtreecommitdiff
path: root/js/codeq/core.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/codeq/core.js')
-rw-r--r--js/codeq/core.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js
index 22f6a50..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
// ================================================================================
@@ -610,15 +615,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
codeq.log.info('App reset: ' + (reason || 'no reason given'));
codeq.globalStateMachine.transition('login');
codeq.wait(
- codeq.comms.getSid() == null ? Q() : codeq.comms.logout()
+/* codeq.comms.getSid() == null ? Q() : codeq.comms.logout()
.finally(
codeq.comms.disconnect
)
.fail(function (e) {
codeq.log.debug(e)
- }) // ignore errors
+ }) // ignore errors*/
+ codeq.comms.forceReset
)
- .then(function () {
+ .fin(function () {
if (reason) {
alert(reason);
}