From e828f976f16d3a9b5e3fd6c96d5c4f48c0ff5871 Mon Sep 17 00:00:00 2001 From: jomo Date: Sat, 22 Nov 2014 00:22:08 +0100 Subject: [PATCH] removing some errors in networking.skin_file callback 404 shouldn't return an error, null is fine. Setting the error causes that non-existing skins aren't cached. Thus we'd always make a new request to mojang, which will result in hitting the (sessionserver's) rate limit Removing the error for Too Many Requests for the same reason. --- modules/networking.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/networking.js b/modules/networking.js index 2ea5c74..67a8c58 100644 --- a/modules/networking.js +++ b/modules/networking.js @@ -70,18 +70,16 @@ exp.skin_file = function(url, facename, helmname, callback) { console.error("Error downloading '" + url + "': " + error); } else if (response.statusCode == 404) { console.warn(url + " texture not found"); - error = "texture not found" // Setting error } else if (response.statusCode == 429) { // Too Many Requests // Never got this, seems like textures aren't limited - error = "too many requests" // Error needs to be set, otherwise null in callback console.warn(url + " too many requests"); console.warn(body); } else { console.error(url + " unknown error:"); console.error(response); console.error(body); - error = "unknown error" // Setting error + error = "unknown error"; // Error needs to be set, otherwise null in callback } callback(error); }