method Promise.catch
Private
Promise.catch<TResult = never>(onrejected?:
((reason: any) => TResult | PromiseLike<TResult>)
| undefined
| null
): Promise<T | TResult>

Attaches a callback for only the rejection of the Promise.

Type Parameters

TResult = never

Parameters

optional
onrejected:
((reason: any) => TResult | PromiseLike<TResult>)
| undefined
| null

The callback to execute when the Promise is rejected.

Return Type

A Promise for the completion of the callback.