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
|
||||
};
|
||||
var https = require('https');
|
||||
server = https.Server(credentials, routingFunction);
|
||||
server = require('http2').createSecureServer(credentials, routingFunction);
|
||||
} catch(err){
|
||||
console.log("Starting without https (probably on localhost)");
|
||||
server = http.createServer(routingFunction);
|
||||
server = require('http2').createServer(routingFunction);
|
||||
}
|
||||
|
||||
if(clustered) {
|
||||
|
||||
@@ -12,8 +12,10 @@ function get_history(channel, all, socket, pass) {
|
||||
}
|
||||
if(!query.all) {
|
||||
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)) {
|
||||
getAndSendLogs(channel, all, socket, pass, query);
|
||||
if(conf.length > 0) {
|
||||
if(conf[0].userpass == "" || conf[0].userpass == Functions.decrypt_string(socket.zoff_id, pass)) {
|
||||
getAndSendLogs(channel, all, socket, pass, query);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -571,7 +571,6 @@ function send_play(coll, socket, broadcast)
|
||||
}
|
||||
}
|
||||
} catch(e){
|
||||
console.log(e);
|
||||
if(socket) {
|
||||
if(broadcast) {
|
||||
socket.to(coll).emit("np", {});
|
||||
|
||||
@@ -423,8 +423,7 @@ var Frontpage = {
|
||||
|
||||
Helper.log([
|
||||
"Sending frontpage_lists",
|
||||
"Socket",
|
||||
socket
|
||||
"Socket"
|
||||
]);
|
||||
|
||||
Crypt.init();
|
||||
|
||||
@@ -143,10 +143,10 @@ window.zoff = {
|
||||
}
|
||||
|
||||
if(!Helper.mobilecheck()) {
|
||||
window.onerror = function(e) {
|
||||
window.onerror = function(e, source, lineno, colno, error) {
|
||||
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: chan.toLowerCase(), 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 != "" && chan != undefined ? chan.toLowerCase() : "frontpage", date: new Date()});
|
||||
$(".contact-form-content").remove();
|
||||
$("#submit-contact-form").remove();
|
||||
$(".contact-modal-header").text("An error occurred");
|
||||
@@ -1139,7 +1139,8 @@ $(document).on('submit', "#error-report-form", function(e) {
|
||||
$("#error-report-form").remove();
|
||||
$(".error-code-container").remove();
|
||||
$(".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{
|
||||
$(".error-report-success").text("Mail was not sent, try again");
|
||||
}
|
||||
@@ -1151,7 +1152,7 @@ $(document).on('submit', "#error-report-form", function(e) {
|
||||
$(document).on( "click", "#add-many", function(e){
|
||||
var id = $(this).attr("data-video-id");
|
||||
var title = $(this).attr("data-video-title");
|
||||
var original_length = $(this).attr("data-video-length");
|
||||
var original_length = $(this).attr("data-video-length");
|
||||
var parent = $(this).parent().parent();
|
||||
|
||||
var start = parseInt($(parent).find(".result-start").val());
|
||||
|
||||
Reference in New Issue
Block a user