Skip to content

Commit 94dfa0c

Browse files
committed
fix(cli): migrate meta's catch rethrows the exit signal by the house predicate
`test/exit-signal.pin.test.ts` holds every catch that a this.exit() inside its try can reach to open with `if (isExitSignal(error)) throw error;`. The --write failure exits added two such calls, and the catch opened with a hand-rolled `oclif.exit` check instead; the pin named both lines. Same behaviour, the one spelling the pin reads. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RWZbGvPFcRKvUqASZtunCU
1 parent 9f24f3d commit 94dfa0c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/cli/src/commands/migrate

‎packages/cli/src/commands/migrate/meta.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
createTimer,
3030
emitJson,
3131
errorCodeFields,
32+
isExitSignal,
3233
isReportedError,
3334
} from '../../utils/format.js';
3435
import { bootSchemaStack } from '../../utils/schema-migrate.js';
@@ -857,8 +858,7 @@ export default class MigrateMeta extends Command {
857858
// A write refused or undone is a failed run, reported above.
858859
if (write && write.status !== 'written') this.exit(1);
859860
} catch (error: any) {
860-
// `this.exit()` throws; a `--write` failure exits from inside the try.
861-
if (typeof error?.oclif?.exit === 'number') throw error;
861+
if (isExitSignal(error)) throw error;
862862
if (error instanceof MigrationFloorError) {
863863
if (flags.json) {
864864
await emitJson({ error: 'unsupported_from_major', message: error.message }, 0, { compact: true });

0 commit comments

Comments
 (0)