fix: register crash-recording exit handler after all validation passes
Move the process.on('exit') handler that records gateway crashes to
after all CLI validation checks (port, auth, bind, etc.) so that user
configuration errors are not incorrectly counted as gateway crashes.
Addresses review feedback from @greptile-apps.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6eb7b2dc9d
commit
430b320cd0
@ -215,12 +215,6 @@ async function runGatewayCommand(opts: GatewayRunOpts) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
process.on("exit", (code) => {
|
||||
if (code !== 0) {
|
||||
recordGatewayCrash(stateDir);
|
||||
}
|
||||
});
|
||||
|
||||
if (devMode) {
|
||||
await ensureDevGatewayConfig({ reset: Boolean(opts.reset) });
|
||||
}
|
||||
@ -445,6 +439,12 @@ async function runGatewayCommand(opts: GatewayRunOpts) {
|
||||
}
|
||||
: undefined;
|
||||
|
||||
process.on("exit", (code) => {
|
||||
if (code !== 0) {
|
||||
recordGatewayCrash(stateDir);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
await runGatewayLoop({
|
||||
runtime: defaultRuntime,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user