mirror of https://github.com/calzoneman/sync.git
Improve queue fail error reporting
This commit is contained in:
parent
678abbd9da
commit
d688a63bfa
|
@ -1051,7 +1051,9 @@ Channel.prototype.enqueue = function(data, user, callback) {
|
|||
if(err) {
|
||||
if(callback)
|
||||
callback();
|
||||
user.socket.emit("queueFail");
|
||||
if(err === true)
|
||||
err = false;
|
||||
user.socket.emit("queueFail", err);
|
||||
return;
|
||||
}
|
||||
media.queueby = user ? user.name : "";
|
||||
|
|
|
@ -29,7 +29,8 @@ function getJSON(options, callback) {
|
|||
}
|
||||
catch(e) {
|
||||
Logger.errlog.log("JSON fail: " + options.path);
|
||||
callback(true, res.statusCode, null);
|
||||
var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/);
|
||||
callback(m[1] || true, res.statusCode, null);
|
||||
return;
|
||||
}
|
||||
callback(false, res.statusCode, data);
|
||||
|
@ -53,7 +54,8 @@ function getJSONHTTPS(options, callback) {
|
|||
}
|
||||
catch(e) {
|
||||
Logger.errlog.log("JSON fail: " + options.path);
|
||||
callback(true, res.statusCode, null);
|
||||
var m = buffer.match(/<internalReason>([^<]+)<\/internalReason>/);
|
||||
callback(m[1] || true, res.statusCode, null);
|
||||
return;
|
||||
}
|
||||
callback(false, res.statusCode, data);
|
||||
|
@ -229,7 +231,7 @@ exports.getMedia = function(id, type, callback) {
|
|||
case "yt":
|
||||
exports.getYTInfo(id, function(err, res, data) {
|
||||
if(err || res != 200) {
|
||||
callback(true, null);
|
||||
callback(err || true, null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,8 @@ exports.io.sockets.on("connection", function(socket) {
|
|||
|
||||
if(!Config.DEBUG) {
|
||||
process.on("uncaughtException", function(err) {
|
||||
Logger.errlog.log("[SEVERE] Uncaught Exception: " + err);
|
||||
Logger.errlog.log("[SEVERE] Uncaught Exception: " + err);
|
||||
Logger.errlog.log(err.stack);
|
||||
});
|
||||
|
||||
process.on("exit", shutdown);
|
||||
|
|
|
@ -668,6 +668,7 @@ Callbacks = {
|
|||
data = "Queue failed. Check your link to make sure it is valid.";
|
||||
}
|
||||
makeAlert("Error", data, "alert-error")
|
||||
.addClass("span12")
|
||||
.insertAfter($("#mediaurl").parent());
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue