File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ promise = when(1).catch((err: any) => when(2));
164
164
promise = when ( 1 ) . catch ( ( err : any ) => err . good , ( err : any ) => 2 ) ;
165
165
promise = when ( 1 ) . catch ( ( err : any ) => err . good , ( err : any ) => when ( 2 ) ) ;
166
166
167
+ promise = when ( 1 ) . catch ( Error , ( err : any ) => 2 ) ;
168
+ promise = when ( 1 ) . catch ( Error , ( err : any ) => when ( 2 ) ) ;
169
+
167
170
//TODO: error constructor predicate
168
171
169
172
promise = when ( 1 ) . otherwise ( ( err : any ) => 2 ) ;
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ declare module When {
174
174
175
175
// Make sure you test any usage of these overloads, exceptionType must
176
176
// be a constructor with prototype set to an instance of Error.
177
- catch < U > ( exceptionType : any , onRejected ?: ( reason : any ) => Promise < U > ) : Promise < U > ;
177
+ catch < U > ( exceptionType : any , onRejected ?: ( reason : any ) => U | Promise < U > ) : Promise < U > ;
178
178
179
179
finally ( onFulfilledOrRejected : Function ) : Promise < T > ;
180
180
You can’t perform that action at this time.
0 commit comments