Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/dtils/mod.unstable.ts>withErrorRecovery

The best unofficial library of utilities for Deno applications
Go to Latest
function withErrorRecovery
import { withErrorRecovery } from "https://deno.land/x/dtils@2.5.0/mod.unstable.ts";

Call fn, returning its result, but return recoverWith if it errors. If fn returns a promise, use withAsyncErrorRecovery

Parameters

fn: () => T
recoverWith: O