tryCatch<E> method

Future<Result<E>> tryCatch<E>(
  1. Function f
)

Implementation

Future<Result<E>> tryCatch<E>(Function f) async {
  try {
    return await f.call();
  } catch (e, st) {
    return Result.error(msg: e.toString(), stacktrace: st);
  }
}