mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 17:04:49 +08:00
logging monkey error for more codes
This commit is contained in:
parent
02139b34f2
commit
926aa5eb6d
1 changed files with 2 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue