Browse Source

catch 204 responses from mojang

I have no idea what causes 404 and what causes 204, but then it's mojang :poop:
jomo 10 năm trước cách đây
mục cha
commit
ff5e9a601b
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      modules/networking.js

+ 2 - 2
modules/networking.js

@@ -58,7 +58,7 @@ exp.get_from_options = function(rid, url, options, callback) {
       callback(body, response, null);
     } else if (error) {
       callback(body || null, response, error);
-    } else if (response.statusCode === 404) {
+    } else if (response.statusCode === 404 || response.statusCode === 204) {
       // page does not exist
       logging.log(rid + url + " url does not exist");
       callback(null, response, null);
@@ -68,7 +68,7 @@ exp.get_from_options = function(rid, url, options, callback) {
       callback(body || null, response, error);
     } else {
       logging.error(rid + url + " Unknown error:");
-      logging.error(rid + response);
+      logging.error(rid + JSON.stringify(response));
       callback(body || null, response, error);
     }
   });