Aller au contenu

Async Error Swallowed (ARCH3169)

Ce contenu n’est pas encore disponible dans votre langue.

Key typescript.logging.floating-promise · Severity warning · Category logging

Unawaited promises, fire-and-forget calls, and rejected promises with no catch cause failures to vanish untracked. A rejection becomes an unhandled rejection that can crash the Node process.

function onRequest(req: Request) {
audit.record(req); // returns a promise, not awaited, no catch
respond(req);
}
function onRequest(req: Request) {
audit.record(req).catch((err) => {
logger.error("audit record failed", { err });
});
respond(req);
}

Await the promise or attach a .catch handler, and log the rejection.