From 926aa5eb6d33d94e1b47f598a7f431db9c67aebb Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 17 Aug 2021 19:42:40 +0100 Subject: [PATCH] logging monkey error for more codes --- backend/handlers/error.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/handlers/error.js b/backend/handlers/error.js index 790f88f34..e93b4598b 100644 --- a/backend/handlers/error.js +++ b/backend/handlers/error.js @@ -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,