diff --git a/channel.js b/channel.js index 153fd1eb..b858cc33 100644 --- a/channel.js +++ b/channel.js @@ -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 : ""; diff --git a/get-info.js b/get-info.js index 2943cd54..159298c8 100644 --- a/get-info.js +++ b/get-info.js @@ -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>/); + 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>/); + 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; } diff --git a/server.js b/server.js index 7338f94d..41c3d203 100644 --- a/server.js +++ b/server.js @@ -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); diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index 938517ef..5174de7a 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -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()); },