-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
Is there any chance, you could change the any type on error parameter on the catch method of a Promise, to a type argument instead? The type argument is provided in the Promise<R, E> type annotation, instead of just Promise<R> .
/**
* Sugar for promise.then(undefined, onRejected)
*
* @param onRejected called when/if "promise" rejects
*/
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;I need to type annotate many catch method calls right now with:
.catch(error: HTTPResponse<ErrorResponse> | Error)mikea
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug