mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Better error-logging
This commit is contained in:
@@ -78,10 +78,10 @@ function startSingle(clustered, redis_enabled) {
|
|||||||
ca: ca
|
ca: ca
|
||||||
};
|
};
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
server = https.Server(credentials, routingFunction);
|
server = require('http2').createSecureServer(credentials, routingFunction);
|
||||||
} catch(err){
|
} catch(err){
|
||||||
console.log("Starting without https (probably on localhost)");
|
console.log("Starting without https (probably on localhost)");
|
||||||
server = http.createServer(routingFunction);
|
server = require('http2').createServer(routingFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(clustered) {
|
if(clustered) {
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ function get_history(channel, all, socket, pass) {
|
|||||||
}
|
}
|
||||||
if(!query.all) {
|
if(!query.all) {
|
||||||
db.collection(channel + "_settings").find({id: "config"}, function(err, conf) {
|
db.collection(channel + "_settings").find({id: "config"}, function(err, conf) {
|
||||||
if(conf.length > 0 && conf[0].userpass == "" || conf[0].userpass == Functions.decrypt_string(socket.zoff_id, pass)) {
|
if(conf.length > 0) {
|
||||||
|
if(conf[0].userpass == "" || conf[0].userpass == Functions.decrypt_string(socket.zoff_id, pass)) {
|
||||||
getAndSendLogs(channel, all, socket, pass, query);
|
getAndSendLogs(channel, all, socket, pass, query);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
getAndSendLogs(channel, all, socket, pass, query);
|
getAndSendLogs(channel, all, socket, pass, query);
|
||||||
|
|||||||
@@ -571,7 +571,6 @@ function send_play(coll, socket, broadcast)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(e){
|
} catch(e){
|
||||||
console.log(e);
|
|
||||||
if(socket) {
|
if(socket) {
|
||||||
if(broadcast) {
|
if(broadcast) {
|
||||||
socket.to(coll).emit("np", {});
|
socket.to(coll).emit("np", {});
|
||||||
|
|||||||
@@ -423,8 +423,7 @@ var Frontpage = {
|
|||||||
|
|
||||||
Helper.log([
|
Helper.log([
|
||||||
"Sending frontpage_lists",
|
"Sending frontpage_lists",
|
||||||
"Socket",
|
"Socket"
|
||||||
socket
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Crypt.init();
|
Crypt.init();
|
||||||
|
|||||||
@@ -143,10 +143,10 @@ window.zoff = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!Helper.mobilecheck()) {
|
if(!Helper.mobilecheck()) {
|
||||||
window.onerror = function(e) {
|
window.onerror = function(e, source, lineno, colno, error) {
|
||||||
if(e == "Script error.") return true;
|
if(e == "Script error.") return true;
|
||||||
Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date()});
|
Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source});
|
||||||
Helper.logs.unshift({log: chan.toLowerCase(), date: new Date()});
|
Helper.logs.unshift({log: chan != "" && chan != undefined ? chan.toLowerCase() : "frontpage", date: new Date()});
|
||||||
$(".contact-form-content").remove();
|
$(".contact-form-content").remove();
|
||||||
$("#submit-contact-form").remove();
|
$("#submit-contact-form").remove();
|
||||||
$(".contact-modal-header").text("An error occurred");
|
$(".contact-modal-header").text("An error occurred");
|
||||||
@@ -1139,7 +1139,8 @@ $(document).on('submit', "#error-report-form", function(e) {
|
|||||||
$("#error-report-form").remove();
|
$("#error-report-form").remove();
|
||||||
$(".error-code-container").remove();
|
$(".error-code-container").remove();
|
||||||
$(".error-report-success").text("Error report sent!");
|
$(".error-report-success").text("Error report sent!");
|
||||||
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.")
|
$("#contact-container").html("Mail has been sent, we'll be back with you shortly.");
|
||||||
|
window.location.reload(true);
|
||||||
}else{
|
}else{
|
||||||
$(".error-report-success").text("Mail was not sent, try again");
|
$(".error-report-success").text("Mail was not sent, try again");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user