Function tryCatch

Source
tryCatch<T, E = Error>(fn: () => T): Result<T, E>

Wrap a function with try-catch and return a Result.