@@ -125,6 +125,7 @@ async function cli(argv) {
125
125
await command . execute ( ) ;
126
126
} catch ( error ) {
127
127
if ( ! program . opts ( ) . json ) {
128
+ console . error ( 'Command failed:' , error . message ) ;
128
129
process . exit ( 1 ) ;
129
130
}
130
131
}
@@ -137,7 +138,7 @@ async function cli(argv) {
137
138
138
139
db . command ( 'reset' )
139
140
. description ( 'Reset the local database' )
140
- . action ( async ( options ) => {
141
+ . action ( async ( ) => {
141
142
const parentOpts = program . opts ( ) ;
142
143
const { default : ResetCommand } = await import ( './commands/db/ResetCommand.js' ) ;
143
144
const { default : CliReporter } = await import ( './reporters/CliReporter.js' ) ;
@@ -158,6 +159,7 @@ async function cli(argv) {
158
159
await command . execute ( ) ;
159
160
} catch ( error ) {
160
161
if ( ! parentOpts . json ) {
162
+ console . error ( 'Command failed:' , error . message ) ;
161
163
process . exit ( 1 ) ;
162
164
}
163
165
}
@@ -185,6 +187,7 @@ async function cli(argv) {
185
187
await command . execute ( sql , options . file ) ;
186
188
} catch ( error ) {
187
189
if ( ! parentOpts . json ) {
190
+ console . error ( 'Command failed:' , error . message ) ;
188
191
process . exit ( 1 ) ;
189
192
}
190
193
}
@@ -222,6 +225,7 @@ async function cli(argv) {
222
225
await command . execute ( compileOptions ) ;
223
226
} catch ( error ) {
224
227
if ( ! parentOpts . json ) {
228
+ console . error ( 'Command failed:' , error . message ) ;
225
229
process . exit ( 1 ) ;
226
230
}
227
231
}
@@ -274,6 +278,7 @@ async function cli(argv) {
274
278
await command . execute ( args ) ;
275
279
} catch ( error ) {
276
280
if ( ! parentOpts . json ) {
281
+ console . error ( 'Command failed:' , error . message ) ;
277
282
process . exit ( 1 ) ;
278
283
}
279
284
}
@@ -300,6 +305,7 @@ async function cli(argv) {
300
305
await command . execute ( options ) ;
301
306
} catch ( error ) {
302
307
if ( ! parentOpts . json ) {
308
+ console . error ( 'Command failed:' , error . message ) ;
303
309
process . exit ( 1 ) ;
304
310
}
305
311
}
@@ -328,14 +334,15 @@ async function cli(argv) {
328
334
await command . execute ( functionNames , options ) ;
329
335
} catch ( error ) {
330
336
if ( ! parentOpts . json ) {
337
+ console . error ( 'Command failed:' , error . message ) ;
331
338
process . exit ( 1 ) ;
332
339
}
333
340
}
334
341
} ) ;
335
342
336
343
functions . command ( 'validate [functions...]' )
337
344
. description ( 'Validate Edge Functions without deploying' )
338
- . action ( async ( functionNames , options ) => {
345
+ . action ( async ( functionNames , _options ) => {
339
346
const parentOpts = program . opts ( ) ;
340
347
const { ValidateCommand } = await import ( './commands/functions/index.js' ) ;
341
348
const { default : CliReporter } = await import ( './reporters/CliReporter.js' ) ;
@@ -353,14 +360,15 @@ async function cli(argv) {
353
360
await command . execute ( functionNames ) ;
354
361
} catch ( error ) {
355
362
if ( ! parentOpts . json ) {
363
+ console . error ( 'Command failed:' , error . message ) ;
356
364
process . exit ( 1 ) ;
357
365
}
358
366
}
359
367
} ) ;
360
368
361
369
functions . command ( 'status [functions...]' )
362
370
. description ( 'Show Edge Functions deployment status' )
363
- . action ( async ( functionNames , options ) => {
371
+ . action ( async ( functionNames , _options ) => {
364
372
const parentOpts = program . opts ( ) ;
365
373
const { StatusCommand } = await import ( './commands/functions/index.js' ) ;
366
374
const { default : CliReporter } = await import ( './reporters/CliReporter.js' ) ;
@@ -373,6 +381,7 @@ async function cli(argv) {
373
381
await command . execute ( functionNames ) ;
374
382
} catch ( error ) {
375
383
if ( ! parentOpts . json ) {
384
+ console . error ( 'Command failed:' , error . message ) ;
376
385
process . exit ( 1 ) ;
377
386
}
378
387
}
@@ -385,7 +394,7 @@ async function cli(argv) {
385
394
386
395
test . command ( 'compile' )
387
396
. description ( 'Compile tests for execution' )
388
- . action ( async ( options ) => {
397
+ . action ( async ( ) => {
389
398
const parentOpts = program . opts ( ) ;
390
399
const { CompileCommand } = await import ( './commands/test/index.js' ) ;
391
400
const { default : CliReporter } = await import ( './reporters/CliReporter.js' ) ;
@@ -403,6 +412,7 @@ async function cli(argv) {
403
412
await command . execute ( ) ;
404
413
} catch ( error ) {
405
414
if ( ! parentOpts . json ) {
415
+ console . error ( 'Command failed:' , error . message ) ;
406
416
process . exit ( 1 ) ;
407
417
}
408
418
}
@@ -445,6 +455,7 @@ async function cli(argv) {
445
455
}
446
456
} catch ( error ) {
447
457
if ( ! parentOpts . json ) {
458
+ console . error ( 'Command failed:' , error . message ) ;
448
459
process . exit ( 1 ) ;
449
460
}
450
461
}
@@ -485,6 +496,7 @@ async function cli(argv) {
485
496
}
486
497
} catch ( error ) {
487
498
if ( ! parentOpts . json ) {
499
+ console . error ( 'Command failed:' , error . message ) ;
488
500
process . exit ( 1 ) ;
489
501
}
490
502
}
@@ -518,6 +530,7 @@ async function cli(argv) {
518
530
await command . execute ( options ) ;
519
531
} catch ( error ) {
520
532
if ( ! parentOpts . json ) {
533
+ console . error ( 'Command failed:' , error . message ) ;
521
534
process . exit ( 1 ) ;
522
535
}
523
536
}
@@ -547,6 +560,7 @@ async function cli(argv) {
547
560
await command . execute ( options ) ;
548
561
} catch ( error ) {
549
562
if ( ! parentOpts . json ) {
563
+ console . error ( 'Command failed:' , error . message ) ;
550
564
process . exit ( 1 ) ;
551
565
}
552
566
}
@@ -575,6 +589,7 @@ async function cli(argv) {
575
589
await command . execute ( options ) ;
576
590
} catch ( error ) {
577
591
if ( ! parentOpts . json ) {
592
+ console . error ( 'Command failed:' , error . message ) ;
578
593
process . exit ( 1 ) ;
579
594
}
580
595
}
@@ -615,6 +630,7 @@ async function cli(argv) {
615
630
await command . execute ( { type : testType , name : testName } ) ;
616
631
} catch ( error ) {
617
632
if ( ! parentOpts . json ) {
633
+ console . error ( 'Command failed:' , error . message ) ;
618
634
process . exit ( 1 ) ;
619
635
}
620
636
}
@@ -648,6 +664,7 @@ async function cli(argv) {
648
664
await command . execute ( options ) ;
649
665
} catch ( error ) {
650
666
if ( ! parentOpts . json ) {
667
+ console . error ( 'Command failed:' , error . message ) ;
651
668
process . exit ( 1 ) ;
652
669
}
653
670
}
@@ -677,6 +694,7 @@ async function cli(argv) {
677
694
await command . execute ( options ) ;
678
695
} catch ( error ) {
679
696
// CI commands always exit with proper codes
697
+ console . error ( 'CI command failed:' , error . message ) ;
680
698
process . exit ( 1 ) ;
681
699
}
682
700
} ) ;
@@ -711,6 +729,7 @@ async function cli(argv) {
711
729
const exitCode = command . getExitCode ( results ) ;
712
730
process . exit ( exitCode ) ;
713
731
} catch ( error ) {
732
+ console . error ( 'CI command failed:' , error . message ) ;
714
733
process . exit ( 1 ) ;
715
734
}
716
735
} ) ;
@@ -740,6 +759,7 @@ async function cli(argv) {
740
759
await command . execute ( options ) ;
741
760
// CI coverage command handles its own exit codes via process.exitCode
742
761
} catch ( error ) {
762
+ console . error ( 'CI command failed:' , error . message ) ;
743
763
process . exit ( 1 ) ;
744
764
}
745
765
} ) ;
0 commit comments