This repository was archived by the owner on Feb 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ export default function (o: Rx.Subject<Message>): Rx.Observable<any> {
61
61
// and can be ignored
62
62
try {
63
63
if ( err . code === 'EPIPE' ) return
64
- if ( typeof err . exitCode === 'number' ) {
65
- process . exit ( err . exitCode )
64
+ if ( err [ 'cli-ux' ] && typeof err [ 'cli-ux' ] . exitCode === 'number' ) {
65
+ process . exit ( err [ 'cli-ux' ] . exitCode )
66
66
} else {
67
67
const cli = new CLI ( scope )
68
68
cli . fatal ( err , { exit : false } )
Original file line number Diff line number Diff line change 1
1
export class ExitError extends Error {
2
- public exitCode : number
2
+ public 'cli-ux' : {
3
+ exitCode : number
4
+ }
3
5
public code : 'EEXIT'
4
6
public error ?: Error
5
7
6
8
constructor ( status : number , error ?: Error ) {
7
9
const code = 'EEXIT'
8
10
super ( error ? error . message : `${ code } : ${ status } ` )
9
11
this . error = error
10
- this . exitCode = status
12
+ this [ 'cli-ux' ] = { exitCode : status }
11
13
this . code = code
12
14
}
13
15
}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class CLI {
37
37
const code = getExitCode ( options )
38
38
if ( code === false ) return
39
39
let exitErr : ExitError = error as any
40
- exitErr . exitCode = exitErr . exitCode || code
40
+ exitErr [ 'cli-ux' ] = exitErr [ 'cli-ux' ] || { exitCode : code }
41
41
throw exitErr
42
42
}
43
43
You can’t perform that action at this time.
0 commit comments