Skip to main content

core.readablepromise.catch

Home > @medplum/core > ReadablePromise > catch

ReadablePromise.catch() method

Attaches a callback for only the rejection of the Promise.

Signature:

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

Parameters

Parameter

Type

Description

onrejected

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

(Optional) The callback to execute when the Promise is rejected.

Returns:

Promise<T | TResult>

A Promise for the completion of the callback.