Skip to main content
Module

x/ramda/mod.ts>tryCatch

:ram: Practical functional Javascript
Latest
variable tryCatch
import { tryCatch } from "https://deno.land/x/ramda@v0.27.2/mod.ts";

tryCatch takes two functions, a tryer and a catcher. The returned function evaluates the tryer; if it does not throw, it simply returns the result. If the tryer does throw, the returned function evaluates the catcher function and returns its result. Note that for effective composition with this function, both the tryer and catcher functions must return the same type of results.