mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-30 07:14:39 +08:00
Log hot-shots' failed final flush through an unknown value
Programs whose Error subclasses define accessors still compile the shim's close logging. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8c9f5cfc9f
commit
2e297caf99
@@ -155,6 +155,13 @@ function formatDate(date: number): number {
|
||||
return Math.round(date);
|
||||
}
|
||||
|
||||
/** console.error of an arbitrary value, as hot-shots logs errors. The
|
||||
* value crosses as unknown: the typed Error path has no inspect lowering
|
||||
* in programs whose Error subclasses define accessors. */
|
||||
function logError(value: unknown): void {
|
||||
console.error(value);
|
||||
}
|
||||
|
||||
function errorWithCode(message: string, code: string | undefined): Error {
|
||||
const error: NodeJS.ErrnoException = new Error(message);
|
||||
error.code = code;
|
||||
@@ -1013,7 +1020,7 @@ export class StatsD {
|
||||
this.flushQueue((err) => {
|
||||
if (err) {
|
||||
if (callback) return callback(err);
|
||||
console.error(err);
|
||||
logError(err);
|
||||
return;
|
||||
}
|
||||
let intervalAttempts = 0;
|
||||
|
||||
Reference in New Issue
Block a user