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)
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 justPromise<R>.I need to type annotate many catch method calls right now with: