MCPcopy
hub / github.com/pyodide/pyodide / catch

Method catch

src/core/pyproxy.ts:2637–2640  ·  view source on GitHub ↗

* Calls :func:`asyncio.ensure_future` on the awaitable and executes * ``onRejected(error)`` if the :py:class:`~asyncio.Future` fails. * * See the documentation for :js:meth:`Promise.catch`. * * @param onRejected A handler called with the error as an argument if the * awaitable fail

(onRejected: (reason: any) => any)

Source from the content-addressed store, hash-verified

2635 * @returns The resulting Promise.
2636 */
2637 catch(onRejected: (reason: any) => any) {
2638 let promise = this._ensure_future();
2639 return promise.catch(onRejected);
2640 }
2641 /**
2642 * Calls :func:`asyncio.ensure_future` on the awaitable and executes
2643 * ``onFinally(error)`` when the :py:class:`~asyncio.Future` resolves.

Callers 3

closeFunction · 0.45
shutdownFunction · 0.45

Calls 1

_ensure_futureMethod · 0.95

Tested by

no test coverage detected