core.readablepromise.catch | Medplum

ReadablePromise.catch() method

Attaches a callback for only the rejection of the Promise.

Signature:

catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;

Parameters

Parameter Type Description
onrejected ((reason: any) => TResult | PromiseLike) | null (Optional) The callback to execute when the Promise is rejected.

Returns:

Promise<T | TResult>

A Promise for the completion of the callback.