Added a catch in promise for Jimp read

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-04 11:38:04 +02:00
committed by GitHub
parent 21947a2717
commit 0a1f800659

View File

@@ -701,6 +701,14 @@ function sendColor(coll, socket, url, ajax, res) {
io.to(coll).emit("color", {color: c, only: false});
}
}
}).catch(function(err) {
console.log("Crashed on fetching image, url is " + url);
console.log("Is ajax: " + ajax);
if(ajax) {
res.header({"Content-Type": "application/json"});
res.status(404);
return;
}
});
}