تخطَّ إلى المحتوى

Exception Not Logged With Object (ARCH3159)

هذا المحتوى غير متوفر بلغتك بعد.

Key typescript.logging.exception-not-logged · Severity warning · Category logging

Logging only a static message string inside a catch while dropping the exception object loses the stack trace and error details. Diagnosing the problem becomes nearly impossible.

try {
await sendEmail(user);
} catch (err) {
logger.error("failed to send email");
}
try {
await sendEmail(user);
} catch (err) {
logger.error("failed to send email", { userId: user.id, err });
}

Include the exception object (and relevant context) in the log call to preserve the stack trace.