logging monkey error for more codes

This commit is contained in:
Miodec 2021-08-17 19:42:40 +01:00
parent 02139b34f2
commit 926aa5eb6d

View file

@ -16,10 +16,11 @@ class MonkeyError {
: "Internal Server Error " + this.errorID;
console.log("Error", message, stack);
if (process.env.MODE !== "dev" && this.status === 500) {
if (process.env.MODE !== "dev" && this.status > 400) {
mongoDB().collection("errors").insertOne({
_id: this.errorID,
timestamp: Date.now(),
status: this.status,
uid,
message,
stack,