mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
log errors only once, fixes #140
also made sure some (network) errors have level 'WARN' these are printed without stacktrace
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
var logging = require("../logging");
|
||||
var helpers = require("../helpers");
|
||||
var config = require("../../config");
|
||||
var skins = require("../skins");
|
||||
@@ -82,7 +81,6 @@ module.exports = function(req, callback) {
|
||||
try {
|
||||
helpers.get_avatar(req.id, userId, helm, size, function(err, status, image, hash) {
|
||||
if (err) {
|
||||
logging.error(req.id, err);
|
||||
if (err.code === "ENOENT") {
|
||||
// no such file
|
||||
cache.remove_hash(req.id, userId);
|
||||
@@ -101,7 +99,6 @@ module.exports = function(req, callback) {
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
logging.error(req.id, "error:", e.stack);
|
||||
handle_default(-1, userId, size, def, req, e, callback);
|
||||
}
|
||||
};
|
||||
@@ -32,7 +32,6 @@ module.exports = function(req, callback) {
|
||||
try {
|
||||
helpers.get_cape(rid, userId, function(err, hash, status, image) {
|
||||
if (err) {
|
||||
logging.error(rid, err);
|
||||
if (err.code === "ENOENT") {
|
||||
// no such file
|
||||
cache.remove_hash(rid, userId);
|
||||
|
||||
@@ -98,7 +98,6 @@ module.exports = function(req, callback) {
|
||||
try {
|
||||
helpers.get_render(rid, userId, scale, helm, body, function(err, status, hash, image) {
|
||||
if (err) {
|
||||
logging.error(rid, err);
|
||||
if (err.code === "ENOENT") {
|
||||
// no such file
|
||||
cache.remove_hash(rid, userId);
|
||||
@@ -118,7 +117,6 @@ module.exports = function(req, callback) {
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
logging.error(rid, "error:", e.stack);
|
||||
handle_default(rid, scale, helm, body, -1, userId, scale, def, req, e, callback);
|
||||
}
|
||||
};
|
||||
@@ -81,7 +81,6 @@ module.exports = function(req, callback) {
|
||||
try {
|
||||
helpers.get_skin(rid, userId, function(err, hash, status, image) {
|
||||
if (err) {
|
||||
logging.error(req.id, err);
|
||||
if (err.code === "ENOENT") {
|
||||
// no such file
|
||||
cache.remove_hash(req.id, userId);
|
||||
@@ -100,7 +99,6 @@ module.exports = function(req, callback) {
|
||||
}
|
||||
});
|
||||
} catch(e) {
|
||||
logging.error(rid, "error:", e.stack);
|
||||
handle_default(-1, userId, def, req, e, callback);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user