Handle promise linting (#5488)

This commit is contained in:
Tom Moor
2023-06-28 20:18:18 -04:00
committed by GitHub
parent f3d8129a13
commit 89d5527d39
101 changed files with 395 additions and 343 deletions

View File

@@ -6,6 +6,7 @@ import winston from "winston";
import env from "@server/env";
import Metrics from "@server/logging/Metrics";
import Sentry from "@server/logging/sentry";
import ShutdownHelper from "@server/utils/ShutdownHelper";
import * as Tracing from "./tracer";
const isProduction = env.ENVIRONMENT === "production";
@@ -162,6 +163,18 @@ class Logger {
}
}
/**
* Report a fatal error and shut down the server
*
* @param message A description of the error
* @param error The error that occurred
* @param extra Arbitrary data to be logged that will appear in prod logs
*/
public fatal(message: string, error: Error, extra?: Extra) {
this.error(message, error, extra);
void ShutdownHelper.execute();
}
/**
* Sanitize data attached to logs and errors to remove sensitive information.
*