Skip to content

Commit

Permalink
fix: errors not being logged into the database (@fehmer) (monkeytypeg…
Browse files Browse the repository at this point in the history
  • Loading branch information
fehmer authored Mar 3, 2025
1 parent 12ab49c commit 50f6bd4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/middlewares/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import {
recordServerErrorByVersion,
} from "../utils/prometheus";
import { isDevEnvironment } from "../utils/misc";
import { ObjectId } from "mongodb";
import { version } from "../version";
import { addLog } from "../dal/logs";
import { ExpressRequestWithContext } from "../api/types";

type DBError = {
_id: ObjectId;
_id: string; //we are using uuid here, not objectIds
timestamp: number;
status: number;
uid: string;
Expand Down Expand Up @@ -81,7 +80,7 @@ async function errorHandlingMiddleware(
uid
);
await db.collection<DBError>("errors").insertOne({
_id: new ObjectId(errorId),
_id: errorId,
timestamp: Date.now(),
status: status,
uid,
Expand Down

0 comments on commit 50f6bd4

Please sign in to comment.