浏览代码

prefix errors with requested uuid

jomo 10 年之前
父节点
当前提交
64948368c5
共有 3 个文件被更改,包括 6 次插入6 次删除
  1. 2 2
      routes/avatars.js
  2. 2 2
      routes/renders.js
  3. 2 2
      routes/skins.js

+ 2 - 2
routes/avatars.js

@@ -40,7 +40,7 @@ router.get("/:uuid.:ext?", function(req, res) {
     helpers.get_avatar(uuid, helm, size, function(err, status, image, hash) {
     helpers.get_avatar(uuid, helm, size, function(err, status, image, hash) {
       logging.log(uuid + " - " + human_status[status]);
       logging.log(uuid + " - " + human_status[status]);
       if (err) {
       if (err) {
-        logging.error(err);
+        logging.error(uuid + " " + err);
       }
       }
       etag = hash && hash.substr(0, 32) || "none";
       etag = hash && hash.substr(0, 32) || "none";
       var matches = req.get("If-None-Match") == '"' + etag + '"';
       var matches = req.get("If-None-Match") == '"' + etag + '"';
@@ -60,7 +60,7 @@ router.get("/:uuid.:ext?", function(req, res) {
       }
       }
     });
     });
   } catch(e) {
   } catch(e) {
-    logging.error("Error!");
+    logging.error(uuid + " error:");
     logging.error(e);
     logging.error(e);
     handle_default(500, status);
     handle_default(500, status);
   }
   }

+ 2 - 2
routes/renders.js

@@ -51,7 +51,7 @@ router.get("/:type/:uuid.:ext?", function(req, res) {
     helpers.get_render(uuid, scale, helm, body, function(err, status, hash, image) {
     helpers.get_render(uuid, scale, helm, body, function(err, status, hash, image) {
       logging.log(uuid + " - " + human_status[status]);
       logging.log(uuid + " - " + human_status[status]);
       if (err) {
       if (err) {
-        logging.error(err);
+        logging.error(uuid + " " + err);
       }
       }
       etag = hash && hash.substr(0, 32) || "none";
       etag = hash && hash.substr(0, 32) || "none";
       var matches = req.get("If-None-Match") == '"' + etag + '"';
       var matches = req.get("If-None-Match") == '"' + etag + '"';
@@ -72,7 +72,7 @@ router.get("/:type/:uuid.:ext?", function(req, res) {
       }
       }
     });
     });
   } catch(e) {
   } catch(e) {
-    logging.error("Error!");
+    logging.error(uuid + " error:");
     logging.error(e);
     logging.error(e);
     handle_default(500, status);
     handle_default(500, status);
   }
   }

+ 2 - 2
routes/skins.js

@@ -25,7 +25,7 @@ router.get("/:uuid.:ext?", function(req, res) {
     helpers.get_skin(uuid, function(err, hash, image) {
     helpers.get_skin(uuid, function(err, hash, image) {
       logging.log(uuid);
       logging.log(uuid);
       if (err) {
       if (err) {
-        logging.error(err);
+        logging.error(uuid + " " + err);
       }
       }
       etag = hash && hash.substr(0, 32) || "none";
       etag = hash && hash.substr(0, 32) || "none";
       var matches = req.get("If-None-Match") == '"' + etag + '"';
       var matches = req.get("If-None-Match") == '"' + etag + '"';
@@ -45,7 +45,7 @@ router.get("/:uuid.:ext?", function(req, res) {
       }
       }
     });
     });
   } catch(e) {
   } catch(e) {
-    logging.error("Error!");
+    logging.error(uuid + " error:");
     logging.error(e);
     logging.error(e);
     handle_default(500);
     handle_default(500);
   }
   }