style: format unhandled rejection handler
This commit is contained in:
parent
7eb57b691c
commit
afd57c7e23
@ -14,11 +14,7 @@ const FATAL_ERROR_CODES = new Set([
|
|||||||
"ERR_WORKER_INITIALIZATION_FAILED",
|
"ERR_WORKER_INITIALIZATION_FAILED",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const CONFIG_ERROR_CODES = new Set([
|
const CONFIG_ERROR_CODES = new Set(["INVALID_CONFIG", "MISSING_API_KEY", "MISSING_CREDENTIALS"]);
|
||||||
"INVALID_CONFIG",
|
|
||||||
"MISSING_API_KEY",
|
|
||||||
"MISSING_CREDENTIALS",
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Network error codes that indicate transient failures (shouldn't crash the gateway)
|
// Network error codes that indicate transient failures (shouldn't crash the gateway)
|
||||||
const TRANSIENT_NETWORK_CODES = new Set([
|
const TRANSIENT_NETWORK_CODES = new Set([
|
||||||
@ -145,10 +141,7 @@ export function installUnhandledRejectionHandler(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isConfigError(reason)) {
|
if (isConfigError(reason)) {
|
||||||
console.error(
|
console.error("[moltbot] CONFIGURATION ERROR - requires fix:", formatUncaughtError(reason));
|
||||||
"[moltbot] CONFIGURATION ERROR - requires fix:",
|
|
||||||
formatUncaughtError(reason),
|
|
||||||
);
|
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user