Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

catchError

import { catchError } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/promise.ts";

An alias for Promise.catch

@example
import { reject, catchError } from "./promise.ts";
import { pipe } from "./fn.ts";

const result = await pipe(
  reject(1),
  catchError(() => "Uhoh"),
); // "UhOh"
function catchError<A>(fua: (u: unknown) => A): (ta: Promise<A>) => Promise<A>;
§
catchError<A>(fua: (u: unknown) => A): (ta: Promise<A>) => Promise<A>
[src]

§Type Parameters

§Parameters

§
fua: (u: unknown) => A
[src]

§Return Type

§
(ta: Promise<A>) => Promise<A>
[src]