This repository was archived by the owner on Feb 2, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Expand file tree Collapse file tree 4 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -537,9 +537,9 @@ interface IOpener {
537
537
}
538
538
539
539
interface IErrors {
540
- fail ( formatStr : string , ...args : any [ ] ) : void ;
541
- fail ( opts : { formatStr ?: string ; errorCode ?: number ; suppressCommandHelp ?: boolean } , ...args : any [ ] ) : void ;
542
- failWithoutHelp ( message : string , ...args : any [ ] ) : void ;
540
+ fail ( formatStr : string , ...args : any [ ] ) : never ;
541
+ fail ( opts : { formatStr ?: string ; errorCode ?: number ; suppressCommandHelp ?: boolean } , ...args : any [ ] ) : never ;
542
+ failWithoutHelp ( message : string , ...args : any [ ] ) : never ;
543
543
beginCommand ( action : ( ) => Promise < boolean > , printCommandHelp : ( ) => Promise < boolean > ) : Promise < boolean > ;
544
544
verifyHeap ( message : string ) : void ;
545
545
printCallStack : boolean ;
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export class Errors implements IErrors {
122
122
123
123
public printCallStack : boolean = false ;
124
124
125
- public fail ( optsOrFormatStr : any , ...args : any [ ] ) : void {
125
+ public fail ( optsOrFormatStr : any , ...args : any [ ] ) : never {
126
126
const argsArray = args || [ ] ;
127
127
128
128
let opts = optsOrFormatStr ;
@@ -146,9 +146,9 @@ export class Errors implements IErrors {
146
146
throw exception ;
147
147
}
148
148
149
- public failWithoutHelp ( message : string , ...args : any [ ] ) : void {
149
+ public failWithoutHelp ( message : string , ...args : any [ ] ) : never {
150
150
args . unshift ( message ) ;
151
- this . fail ( { formatStr : util . format . apply ( null , args ) , suppressCommandHelp : true } ) ;
151
+ return this . fail ( { formatStr : util . format . apply ( null , args ) , suppressCommandHelp : true } ) ;
152
152
}
153
153
154
154
public async beginCommand ( action : ( ) => Promise < boolean > , printCommandHelp : ( ) => Promise < boolean > ) : Promise < boolean > {
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ describe("common options", () => {
38
38
testInjector = createTestInjector ( ) ;
39
39
40
40
const errors = new Errors ( testInjector ) ;
41
- errors . failWithoutHelp = ( message : string , ...args : any [ ] ) : void => {
41
+ errors . failWithoutHelp = < any > ( ( message : string , ...args : any [ ] ) : void => {
42
42
isExecutionStopped = true ;
43
- } ;
44
- errors . fail = ( message : string , ...args : any [ ] ) : void => {
43
+ } ) ;
44
+ errors . fail = < any > ( ( message : string , ...args : any [ ] ) : void => {
45
45
isExecutionStopped = true ;
46
- } ;
46
+ } ) ;
47
47
48
48
testInjector . register ( "errors" , errors ) ;
49
49
isExecutionStopped = false ;
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ export class CommonLoggerStub implements ILogger {
43
43
export class ErrorsStub implements IErrors {
44
44
printCallStack : boolean = false ;
45
45
46
- fail ( formatStr : string , ...args : any [ ] ) : void ;
47
- fail ( opts : { formatStr ?: string ; errorCode ?: number ; suppressCommandHelp ?: boolean } , ...args : any [ ] ) : void ;
46
+ fail ( formatStr : string , ...args : any [ ] ) : never ;
47
+ fail ( opts : { formatStr ?: string ; errorCode ?: number ; suppressCommandHelp ?: boolean } , ...args : any [ ] ) : never ;
48
48
49
- fail ( ...args : any [ ] ) {
49
+ fail ( ...args : any [ ] ) : never {
50
50
throw new Error ( util . format . apply ( null , args ) ) ;
51
51
}
52
52
53
- failWithoutHelp ( message : string , ...args : any [ ] ) : void {
53
+ failWithoutHelp ( message : string , ...args : any [ ] ) : never {
54
54
throw new Error ( message ) ;
55
55
}
56
56
You can’t perform that action at this time.
0 commit comments